/* ==========================================================================
   BetPoll - Main Stylesheet
   ========================================================================== */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --color-primary: #1e3a5f;
    --color-secondary: #3d6a99;
    --color-accent: #f4a261;
    --color-bg: #f8f9fa;
    --color-text: #212529;
    --color-muted: #6c757d;
    
    /* Party colors */
    --color-alp: #E53935;
    --color-lnp: #1565C0;
    --color-oth: #78909C;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    background: linear-gradient(135deg, var(--color-lnp) 0%, var(--color-alp) 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
    display: inline-flex;
    align-items: center;
    margin: 0;
}

header h1 span {
    background-color: #FFCD00;
    color: #00843D; /* Australian Green */
    padding: 0 0.4rem;
    border-radius: 4px;
    font-style: normal;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tagline {
    color: #FFCD00; /* Australian Gold */
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

nav a {
    color: #00843D; /* Australian Green */
    background-color: #FFCD00; /* Australian Gold */
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

nav a:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 15px rgba(0,0,0,0.25);
    background-color: #00843D;
    color: #FFCD00;
}

nav a:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background: linear-gradient(135deg, var(--color-alp) 0%, var(--color-lnp) 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 3rem 2rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #FFCD00;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #FFCD00;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   HTMX Loading Indicator
   ========================================================================== */

.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* ==========================================================================
   Shared Components - Donation Card
   ========================================================================== */

.donation-card,
.donation-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.donation-card::before,
.donation-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}

.donation-section {
    padding: 1.75rem 2rem;
    margin-top: 2rem;
}

.donation-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.donation-title {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.donation-section .donation-title {
    font-size: 1.25rem;
}

.donation-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 auto 1rem auto;
    max-width: 480px;
}

.donation-section .donation-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    line-height: 1.6;
    max-width: 540px;
}

.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #0070ba;
    color: #fff;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 112, 186, 0.4);
}

.donate-btn:hover {
    background: #003087;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 112, 186, 0.5);
}

.donate-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Shared Components - Cards
   ========================================================================== */

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--color-muted);
}

/* ==========================================================================
   Shared Components - States
   ========================================================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--color-muted);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--color-muted);
}

/* ==========================================================================
   Home Page - Dashboard
   ========================================================================== */

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#probability-chart {
    width: 100%;
    min-height: 320px;
}

/* ==========================================================================
   Home Page - Data Table
   ========================================================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    table-layout: fixed;
}

.data-table thead th {
    text-align: right;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid #f1f3f4;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.data-table td {
    padding: 0.75rem 1rem;
}

.data-table .date-col {
    color: var(--color-text);
    font-weight: 500;
    width: 28%;
}

.data-table .pct-col {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    text-align: right;
}

.data-table .pct-alp {
    color: var(--color-alp);
}

.data-table .pct-lnp {
    color: var(--color-lnp);
}

.data-table .pct-oth {
    color: var(--color-oth);
}

/* ==========================================================================
   Home Page - Legend
   ========================================================================== */

.legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.alp { background: var(--color-alp); }
.legend-dot.lnp { background: var(--color-lnp); }
.legend-dot.oth { background: var(--color-oth); }

/* ==========================================================================
   Home Page - Expand Button
   ========================================================================== */

.expand-btn-container {
    text-align: center;
    padding: 1rem 0 0.5rem 0;
    border-top: 1px solid #f1f3f4;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: var(--color-muted);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    color: var(--color-text);
}

.expand-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.expand-btn.expanded svg {
    transform: rotate(180deg);
}

/* ==========================================================================
   Home Page - Hidden Rows
   ========================================================================== */

.hidden-row {
    display: none;
}

.hidden-row.visible {
    display: table-row;
}

/* ==========================================================================
   About Page
   ========================================================================== */

.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.about-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.about-header h2 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.lead-text {
    font-size: 1.25rem;
    color: var(--color-muted);
    line-height: 1.6;
}

/* ==========================================================================
   About Page - Content Sections
   ========================================================================== */

.content-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-section h3 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.content-section p {
    margin-bottom: 1rem;
    color: var(--color-text);
    line-height: 1.7;
}

/* ==========================================================================
   About Page - Methodology List
   ========================================================================== */

.methodology-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.methodology-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.methodology-list li::before {
    content: "•";
    color: var(--color-accent);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* ==========================================================================
   About Page - Contact Info
   ========================================================================== */

.contact-info {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ==========================================================================
   Home Page - Changelog
   ========================================================================== */

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.changelog-entry {
    padding: 1rem 1.25rem;
    background: #fafbfc;
    border-radius: 8px;
    border-left: 3px solid var(--color-accent);
}

.changelog-date {
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
}

.changelog-title {
    display: block;
    font-weight: 600;
    margin-top: 0.25rem;
}

.changelog-desc {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin: 0.5rem 0 0 0;
    line-height: 1.5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    .header-left {
        max-width: 70%;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    nav {
        flex-shrink: 0;
    }
    
    nav a {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .card {
        padding: 1rem;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table td,
    .data-table th {
        padding: 0.5rem 0.75rem;
    }
}
