/* ===================================
   GLOBAL STYLES & RESET (Warm Light Glassmorphism)
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    color: #1e1b18;
    line-height: 1.6;
    /* Bokeh office background */
    background-image: url('../images/bg.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    padding-top: 65px;
}

/* Warm light overlay to brighten and unify */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        160deg,
        rgba(255, 252, 245, 0.45) 0%,
        rgba(240, 235, 225, 0.30) 50%,
        rgba(255, 248, 235, 0.40) 100%
    );
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* ===================================
   GLASSMORPHISM UTILITIES
   =================================== */

.glass-panel {
    position: relative;
    border-radius: 24px;
    background: rgba(255, 252, 246, 0.55);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -1px 1px rgba(200, 185, 160, 0.2),
        0 10px 40px rgba(90, 70, 40, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.glass-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0.70) 0%,
            rgba(255, 255, 255, 0.25) 30%,
            rgba(255, 255, 255, 0.08) 60%,
            transparent 100%);
    opacity: 0.5;
}

.glass-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.04);
    opacity: 0.6;
}

/* ===================================
   NAVIGATION BAR
   =================================== */

.navbar {
    background: transparent;
    border-bottom: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

/* Frosted warm glass nav bar */
.navbar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 251, 243, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(200, 185, 155, 0.35);
    box-shadow: 0 2px 20px rgba(90, 70, 40, 0.08);
    z-index: -1;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 65px;
}

.nav-logo {
    color: #3d2e1a;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(90, 70, 40, 0.25));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
}

.nav-link {
    color: rgba(50, 38, 22, 0.70);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #a06e2a;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #3d2e1a;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    z-index: 1001;
}

.nav-toggle .hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: #3d2e1a;
    margin: 6px auto;
    transition: all 0.3s ease;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        right: -100%;
        top: 65px;
        flex-direction: column;
        background: rgba(255, 252, 246, 0.75);
        backdrop-filter: blur(24px) saturate(160%);
        -webkit-backdrop-filter: blur(24px) saturate(160%);
        width: 100%;
        text-align: center;
        transition: right 0.3s ease;
        padding: 20px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.7);
        box-shadow: 0 10px 30px rgba(90, 70, 40, 0.12);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-toggle.active .hamburger:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .nav-toggle.active .hamburger:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .hamburger:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    .nav-link {
        padding: 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(200, 185, 155, 0.15);
        font-size: 1.1rem;
    }

    .nav-item:last-child .nav-link {
        border-bottom: none;
    }
}

/* ===================================
   HEADER SECTION
   =================================== */

.header {
    text-align: center;
    margin: 40px auto 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.header-logo-img {
    width: 110px;
    height: auto;
    margin-bottom: 0;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 15px 15px rgba(90, 70, 40, 0.25));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo {
    text-align: left;
    font-size: 3.8rem;
    font-weight: 700;
    color: #2c2015;
    margin-bottom: 0;
    letter-spacing: -0.5px;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.6), 0 1px 3px rgba(90, 70, 40, 0.15);
}

.tagline {
    font-size: 1.15rem;
    color: rgba(50, 38, 22, 0.65);
    font-weight: 500;
    margin: 0 auto;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5);
}

/* ===================================
   CARD STYLES (Form & Result)
   =================================== */

.form-section,
.result-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.form-card,
.result-card {
    padding: 50px 40px 40px;
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 252, 246, 0.58);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.80);
    border-radius: 2rem;
    box-shadow:
        0 8px 40px rgba(90, 70, 40, 0.14),
        inset 0 4px 20px rgba(255, 255, 255, 0.50);
    overflow: hidden;
}

.form-card::after,
.result-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
        inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
    opacity: 0.55;
    z-index: 1;
    pointer-events: none;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-icon-top {
    font-size: 2.5rem;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 250, 240, 0.95);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 0 30px 15px rgba(200, 160, 80, 0.10),
        0 4px 16px rgba(90, 70, 40, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.85);
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(190, 145, 60, 0.2); }
    to   { box-shadow: 0 0 25px rgba(190, 145, 60, 0.5); }
}

.form-title {
    font-size: 1.6rem;
    color: #2c2015;
    margin-top: 15px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
}

.form-description {
    text-align: center;
    color: rgba(50, 38, 22, 0.60);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* ===================================
   FORM ELEMENTS
   =================================== */

.prediction-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
}

.form-label {
    color: rgba(44, 32, 21, 0.85);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group.focused .form-label {
    color: #c08a42;
    transform: translateX(5px);
}

.required {
    color: #c0392b;
}

.form-input,
.form-select {
    padding: 14px 16px;
    background: rgba(255, 252, 244, 0.65);
    border: 1px solid rgba(200, 185, 155, 0.45);
    border-radius: 12px;
    font-size: 1rem;
    color: #2c2015;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    width: 100%;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c08a42' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
    cursor: pointer;
}

.form-select::-ms-expand {
    display: none;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #c08a42;
    background-color: rgba(255, 252, 244, 0.85);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(192, 138, 66, 0.12), 0 0 0 3px rgba(192, 138, 66, 0.18);
}

.form-select option,
.form-select optgroup {
    background: #fdf8ef;
    color: #2c2015;
}

.form-input::placeholder {
    color: rgba(50, 38, 22, 0.35);
}

.field-hint {
    font-size: 0.8rem;
    color: rgba(50, 38, 22, 0.42);
    margin-top: 2px;
}

/* ===================================
   CUSTOM SELECT UI (ANIMATED)
   =================================== */

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 252, 244, 0.65);
    border: 1px solid rgba(200, 185, 155, 0.45);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-wrapper.open .custom-select-trigger,
.custom-select-trigger:focus,
.custom-select-trigger:active {
    border-color: #c08a42;
    background-color: rgba(255, 252, 244, 0.85);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(192, 138, 66, 0.12), 0 0 0 3px rgba(192, 138, 66, 0.18);
    outline: none;
}

.custom-select-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
    color: #2c2015;
    font-family: inherit;
}

.custom-select-text.placeholder-text {
    color: rgba(50, 38, 22, 0.35);
}

.custom-select-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-wrapper.open .custom-select-icon {
    transform: rotate(180deg);
}

.custom-options-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(255, 252, 246, 0.85);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(90, 70, 40, 0.12), inset 0 4px 20px rgba(255, 255, 255, 0.50);
}

.custom-select-wrapper.open .custom-options-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-select-mobile-header {
    display: none;
    padding: 15px 20px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(200, 185, 155, 0.3);
    font-weight: 600;
    color: #2c2015;
    background: rgba(255, 252, 246, 0.9);
}

.custom-select-mobile-header button {
    background: rgba(200, 185, 155, 0.2);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3d2e1a;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.custom-select-mobile-header button:hover {
    background: rgba(200, 185, 155, 0.4);
}

.custom-options-scroll {
    max-height: 280px;
    overflow-y: auto;
    padding: 10px 0;
}

.custom-options-scroll::-webkit-scrollbar {
    width: 6px;
}
.custom-options-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.custom-options-scroll::-webkit-scrollbar-thumb {
    background: rgba(200, 185, 155, 0.6);
    border-radius: 10px;
}

.custom-select-optgroup-label {
    padding: 6px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(50, 38, 22, 0.60);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.custom-select-option {
    padding: 12px 16px 12px 24px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #2c2015;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
}

.custom-select-option:hover {
    background: rgba(192, 138, 66, 0.12);
    padding-left: 28px;
}

.custom-select-option.selected {
    color: #c08a42;
    font-weight: 600;
    background: rgba(192, 138, 66, 0.08);
}

.custom-select-option.selected::before {
    content: '✓';
    position: absolute;
    left: 8px;
    font-size: 0.9rem;
}

.custom-select-backdrop {
    display: none;
}

/* MOBILE VIEW - Bottom Sheet Animation */
@media (max-width: 768px) {
    .custom-select-backdrop {
        display: block;
        position: fixed;
        top: 0; left: 0;
        width: 100vw; height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .custom-select-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    .custom-options-list {
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        width: 100%;
        max-height: 50vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        z-index: 1000;
        padding: 0;
        box-shadow: 0 -10px 40px rgba(90, 70, 40, 0.15);
        background: rgba(255, 252, 246, 0.95);
    }

    .custom-select-mobile-header {
        display: flex;
    }

    .custom-options-scroll {
        max-height: calc(50vh - 60px);
        padding: 10px 0 30px;
    }
}

/* ===================================
   BUTTONS
   =================================== */

.submit-btn {
    background: linear-gradient(135deg, #c08a42 0%, #a06e2a 100%);
    color: #fff8ec;
    border: 1px solid rgba(255, 240, 200, 0.35);
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(192, 138, 66, 0.30),
        inset 0 0 10px rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 32px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    z-index: -1;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.submit-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(192, 138, 66, 0.45),
        inset 0 0 15px rgba(255, 255, 255, 0.25);
}

.submit-btn:active {
    transform: translateY(0) scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-btn.loading .btn-text::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40%      { content: '..'; }
    60%, 100%{ content: '...'; }
}

/* ===================================
   ERROR MESSAGE
   =================================== */

.error-message {
    background: rgba(220, 80, 60, 0.10);
    border: 1px solid rgba(220, 80, 60, 0.40);
    color: #9b2a1a;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-message::before {
    content: '⚠️';
}

/* ===================================
   DASHBOARD STATS (Below form)
   =================================== */
.dashboard-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px auto 20px;
    max-width: 800px;
    flex-wrap: wrap;
}

.stat-widget {
    flex: 1;
    min-width: 180px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    position: relative;
    overflow: hidden;
    background: rgba(255, 252, 246, 0.55);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.70);
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(90, 70, 40, 0.12),
        inset 0 4px 20px rgba(255, 255, 255, 0.40);
}

.stat-widget::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
        inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
    opacity: 0.55;
    z-index: 1;
    pointer-events: none;
}

.stat-widget .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 20px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-widget .stat-label {
    font-size: 0.75rem;
    color: rgba(50, 38, 22, 0.50);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
}

.stat-widget .stat-val {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c2015;
}

/* Mini Chart inside widget */
.mini-chart {
    width: 100%;
    height: 30px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 30" preserveAspectRatio="none"><path d="M0,20 L20,10 L40,25 L60,5 L80,15 L100,0" fill="none" stroke="%23c08a42" stroke-width="2" vector-effect="non-scaling-stroke"/></svg>') center/100% 100% no-repeat;
    margin-top: 10px;
    opacity: 0.8;
}

/* ===================================
   RESULT SECTION
   =================================== */

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(180, 160, 120, 0.25);
    padding-bottom: 15px;
}

.result-title {
    font-size: 1.4rem;
    color: #2c2015;
    font-weight: 600;
}

.close-btn {
    background: rgba(200, 185, 155, 0.15);
    border: none;
    color: rgba(50, 38, 22, 0.55);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(200, 80, 60, 0.12);
    color: #c0392b;
}

.result-content {
    text-align: center;
}

.result-icon {
    font-size: 4.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 10px 10px rgba(90, 70, 40, 0.25));
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-prediction {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #2c2015;
}

.result-card.win .result-prediction {
    color: #1a6644;
}

.result-card.lose .result-prediction {
    color: #a0281a;
}

.result-details {
    position: relative;
    background: rgba(255, 250, 240, 0.50);
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    border: 1px solid rgba(200, 185, 155, 0.45);
    border-radius: 1.25rem;
    box-shadow: 0 4px 16px rgba(90, 70, 40, 0.08),
        inset 0 2px 8px rgba(255, 255, 255, 0.45);
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.result-details::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    opacity: 0.50;
    z-index: -1;
    pointer-events: none;
}

.result-details p {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 1.05rem;
}

.result-details strong {
    color: rgba(50, 38, 22, 0.60);
    font-weight: 500;
}

.confidence-bar {
    background: rgba(180, 160, 120, 0.20);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0 30px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #c08a42, #4a7c59);
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.new-prediction-btn {
    width: 100%;
    background: rgba(200, 185, 155, 0.18);
    color: #3d2e1a;
    border: 1px solid rgba(200, 185, 155, 0.40);
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-prediction-btn:hover {
    background: rgba(200, 185, 155, 0.30);
}

/* ===================================
   PARTY INFO BOX & PAGES
   =================================== */

.party-info-box {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px dashed rgba(180, 160, 120, 0.30);
    text-align: left;
}

.party-info-title {
    font-size: 1.1rem;
    color: #2c2015;
    margin-bottom: 15px;
}

.party-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.party-stat {
    background: rgba(255, 252, 244, 0.62);
    padding: 12px;
    border-radius: 1rem;
    border: 1px solid rgba(200, 185, 155, 0.45);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 4px 16px rgba(90, 70, 40, 0.08),
        inset 0 2px 8px rgba(255, 255, 255, 0.40);
}

.party-stat::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
        inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
    opacity: 0.50;
    z-index: 1;
    pointer-events: none;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(50, 38, 22, 0.50);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c2015;
}

.view-party-btn {
    display: block;
    text-align: center;
    color: #a06e2a;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 10px;
    transition: color 0.2s ease;
}

.view-party-btn:hover {
    color: #7a5020;
}

/* Parties Grid */
.parties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.party-card {
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
    background: rgba(255, 252, 246, 0.55);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(90, 70, 40, 0.12),
        inset 0 4px 20px rgba(255, 255, 255, 0.40);
}

.party-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
        inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
    opacity: 0.55;
    z-index: 1;
    pointer-events: none;
}

.party-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 252, 246, 0.72);
    border-color: rgba(192, 138, 66, 0.45);
    box-shadow: 0 12px 40px rgba(90, 70, 40, 0.18),
        inset 0 4px 20px rgba(255, 255, 255, 0.50);
}

.party-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.party-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c2015;
    text-align: center;
    margin-bottom: 20px;
}

.party-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(180, 160, 120, 0.15);
    color: #3d2e1a;
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    text-align: center;
    padding: 40px 20px;
    color: rgba(50, 38, 22, 0.45);
    margin-top: 60px;
    border-top: 1px solid rgba(180, 160, 120, 0.20);
    font-size: 0.85rem;
}

.footer p {
    margin: 5px 0;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 480px) {
    .header-main {
        flex-direction: column;
        text-align: center;
    }

    .header-logo-img {
        width: 80px;
    }

    .logo {
        font-size: 2.2rem;
        text-align: center;
    }

    .form-card,
    .result-card {
        padding: 30px 20px;
    }

    .form-icon-top {
        font-size: 2.5rem;
        top: -20px;
    }

    .submit-btn {
        width: 100%;
    }

    .dashboard-stats {
        flex-direction: column;
    }

    .stat-widget {
        width: 100%;
    }

    .party-stats {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   MAJORITY INDICATOR (Soft Signal)
   =================================== */

.majority-container {
    margin-top: 10px;
    padding: 12px;
    background: rgba(255, 248, 232, 0.55);
    border-radius: 12px;
    border: 1px solid rgba(200, 175, 130, 0.30);
}

.majority-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: rgba(50, 38, 22, 0.60);
}

.majority-bar-bg {
    height: 8px;
    background: rgba(180, 160, 120, 0.20);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.majority-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c0392b, #c08a42, #1a6644);
    background-size: 200% 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.majority-threshold-line {
    position: absolute;
    top: 0;
    left: 50.34%; /* 145 / 288 */
    width: 2px;
    height: 100%;
    background: #3d2e1a;
    box-shadow: 0 0 6px rgba(61, 46, 26, 0.6);
    z-index: 2;
}

.majority-status-text {
    font-weight: 600;
    font-size: 0.75rem;
}

.status-weak    { color: #a0281a; }
.status-near    { color: #a06e2a; }
.status-majority { color: #1a6644; animation: pulseText 2s infinite; }

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* ===================================
   PREDICTION HIGHLIGHTS (Result Chips)
   =================================== */

.highlights-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(180, 160, 120, 0.22);
    text-align: left;
}

.highlights-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(50, 38, 22, 0.50);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.highlights-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.highlight-chip {
    padding: 6px 12px;
    background: rgba(200, 185, 155, 0.15);
    border: 1px solid rgba(180, 160, 120, 0.30);
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #3d2e1a;
    transition: all 0.3s ease;
}

.highlight-chip.positive {
    background: rgba(26, 102, 68, 0.10);
    border-color: rgba(26, 102, 68, 0.30);
    color: #15543a;
}

.highlight-chip.negative {
    background: rgba(192, 57, 43, 0.10);
    border-color: rgba(192, 57, 43, 0.30);
    color: #8e1e14;
}

.highlight-chip.neutral {
    background: rgba(192, 138, 66, 0.10);
    border-color: rgba(192, 138, 66, 0.30);
    color: #7a5020;
}

.highlight-chip:hover {
    transform: translateY(-2px);
    background: rgba(200, 185, 155, 0.25);
}

.prob-floor-note {
    font-size: 0.7rem;
    color: rgba(50, 38, 22, 0.40);
    margin-top: 15px;
    font-style: italic;
    text-align: center;
}