/* ============================================
   FIXES.CSS - UI corrections
   ============================================ */

/* ===== AUTH CARD - blended rounded corners ===== */
.auth-card.glass {
    border-radius: 24px !important;
    border: 1px solid rgba(168, 85, 247, 0.2) !important;
}
.form-group input {
    border-radius: 14px !important;
}

/* ===== ALL PRIMARY/SUBMIT BUTTONS - purple gradient, no white/blue ===== */
button.btn-primary,
button.btn.btn-primary,
.btn.btn-primary,
button[type="submit"],
button.btn-block,
input[type="submit"] {
    border-radius: 999px !important;
    border: none !important;
    cursor: pointer !important;
    color: #0c0612 !important;
    background: linear-gradient(90deg, #7c3aed, #a855f7) !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 20px rgba(168,85,247,0.3) !important;
    transition: filter 0.15s ease, transform 0.08s ease !important;
}
button.btn-primary:hover,
button[type="submit"]:hover {
    filter: brightness(1.08) !important;
    transform: translateY(-1px) !important;
}

/* ===== SIGN UP BUTTON in header - purple not blue ===== */
.header-nav a.btn,
.header-nav a.btn-primary,
a.btn.btn-primary.btn-sm {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 20px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    border: none !important;
    color: #0c0612 !important;
    background: linear-gradient(90deg, #7c3aed, #a855f7) !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(168,85,247,0.3) !important;
    transition: filter 0.15s ease !important;
}
a.btn.btn-primary.btn-sm:hover,
.header-nav a.btn:hover {
    filter: brightness(1.1) !important;
    color: #0c0612 !important;
    text-decoration: none !important;
}

/* ===== NAV LINKS - pill shape ===== */
.header-nav .nav-link {
    border-radius: 999px !important;
    text-decoration: none !important;
    color: rgba(244,241,255,0.8) !important;
    padding: 8px 14px !important;
    transition: all 0.2s !important;
}
.header-nav .nav-link:hover {
    color: #fff !important;
    background: rgba(168,85,247,0.12) !important;
}

/* ===== USER MENU BUTTON ===== */
.user-menu-btn {
    background: rgba(168,85,247,0.12) !important;
    border: 1px solid rgba(168,85,247,0.25) !important;
    border-radius: 999px !important;
    padding: 5px 14px 5px 5px !important;
    transition: all 0.2s !important;
}
.user-menu-btn:hover {
    background: rgba(168,85,247,0.22) !important;
    border-color: rgba(168,85,247,0.45) !important;
}
.user-name { color: rgba(244,241,255,0.92) !important; }

/* ===== DROPDOWN - high z-index, above page content ===== */
.user-dropdown {
    top: calc(100% + 10px) !important;
    margin-top: 0 !important;
    background: rgba(12,8,20,0.98) !important;
    border: 1px solid rgba(168,85,247,0.25) !important;
    border-radius: 16px !important;
    z-index: 10000 !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 30px rgba(168,85,247,0.12) !important;
    backdrop-filter: blur(20px) !important;
}
.user-dropdown a {
    color: rgba(244,241,255,0.8) !important;
    text-decoration: none !important;
}
.user-dropdown a:hover {
    background: rgba(168,85,247,0.12) !important;
    color: #fff !important;
}
.user-dropdown hr {
    border: none !important;
    border-top: 1px solid rgba(168,85,247,0.12) !important;
    margin: 4px 0 !important;
}
.admin-link { color: #c084fc !important; font-weight: 600 !important; }

/* ===== PLAN BADGES ===== */
.badge-pro {
    background: rgba(168,85,247,0.18) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168,85,247,0.3) !important;
    border-radius: 999px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
}
.badge-premium {
    background: rgba(234,179,8,0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(234,179,8,0.3) !important;
    border-radius: 999px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
}
.notif-badge {
    background: #a855f7 !important;
    color: #fff !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
}

/* ===== AUTH LINKS - purple not blue ===== */
.form-link,
.auth-footer a {
    color: #a855f7 !important;
    text-decoration: none !important;
}
.form-link:hover,
.auth-footer a:hover {
    text-decoration: underline !important;
}

/* ===== GLOBAL ===== */
.site-header { position: relative; z-index: 1000; }
*:focus-visible {
    outline: 2px solid rgba(168,85,247,0.5) !important;
    outline-offset: 2px !important;
}

/* ============================================
   RESPONSIVE & PAGE-SPECIFIC FIXES
   ============================================ */

/* ===== BATTLE PAGE ===== */
.battle-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 16px;
    text-align: center;
}

.battle-page h1 {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.battle-page .subtitle {
    color: rgba(244,241,255,0.5);
    margin-bottom: 24px;
}

.battle-cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 24px;
}

.battle-cats button {
    padding: 8px 18px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(244,241,255,0.4);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.battle-cats button.active {
    background: rgba(139,92,246,0.15);
    border-color: #8b5cf6;
    color: #a78bfa;
}

.battle-uploads {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    margin: 24px 0;
}

.battle-zone {
    background: rgba(20,15,30,0.5);
    border: 2px dashed rgba(168,85,247,0.2);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.battle-zone:hover {
    border-color: rgba(168,85,247,0.4);
}

.battle-zone.has-file {
    border-style: solid;
    border-color: rgba(168,85,247,0.3);
}

.battle-zone img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    margin-top: 8px;
}

.battle-zone input { display: none; }

.battle-zone .zone-label {
    font-size: 13px;
    color: rgba(244,241,255,0.3);
}

.battle-vs-label {
    font-size: 24px;
    font-weight: 900;
    color: rgba(139,92,246,0.3);
}

.battle-go {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.battle-go:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.battle-go:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.battle-cost {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(244,241,255,0.3);
}

.battle-cost a {
    color: #a78bfa;
}

.battle-loading {
    display: none;
    margin-top: 24px;
}

/* Battle Result */
.battle-result {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 16px;
    text-align: center;
}

.battle-result h1 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.battle-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
    margin: 32px 0;
}

.battle-card {
    background: rgba(20,15,30,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s;
}

.battle-card.winner {
    border-color: rgba(251,191,36,0.4);
    box-shadow: 0 0 24px rgba(251,191,36,0.1);
}

.battle-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.battle-card-info {
    padding: 16px;
    text-align: center;
}

.battle-card .stars {
    font-size: 20px;
    color: #fbbf24;
}

.battle-card .headline {
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.battle-card .label {
    font-size: 12px;
    color: #a78bfa;
    margin-top: 2px;
}

.battle-vs {
    font-size: 28px;
    font-weight: 900;
    color: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
}

.winner-badge-sm {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 12px;
    color: #000;
    font-weight: 800;
    font-size: 11px;
    margin-bottom: 8px;
}

.battle-cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.battle-cta-row .primary-btn,
.battle-cta-row .secondary-btn {
    width: auto;
    display: inline-flex;
    padding: 14px 28px;
}

/* ===== CHALLENGE PAGE ===== */
.challenge-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 16px;
}

.challenge-header {
    text-align: center;
    margin-bottom: 32px;
}

.challenge-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.challenge-header p {
    color: rgba(244,241,255,0.5);
}

.vs-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.contestant {
    text-align: center;
}

.contestant img {
    width: 100%;
    max-width: 280px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.contestant.blurred img {
    filter: blur(20px);
}

.contestant .stars {
    font-size: 22px;
    color: #fbbf24;
}

.contestant .name {
    font-size: 14px;
    color: rgba(244,241,255,0.6);
    margin-top: 4px;
}

.vs-text {
    font-size: 28px;
    font-weight: 900;
    color: #8b5cf6;
    text-shadow: 0 0 20px rgba(139,92,246,0.4);
    text-align: center;
}

.winner-banner {
    text-align: center;
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(139,92,246,0.1));
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 20px;
}

.winner-banner h2 {
    font-size: 22px;
    color: #fbbf24;
}

.upload-area {
    text-align: center;
    padding: 40px 20px;
    background: rgba(20,15,30,0.6);
    border: 2px dashed rgba(168,85,247,0.3);
    border-radius: 20px;
}

.expired-msg {
    text-align: center;
    padding: 40px;
    color: rgba(244,241,255,0.5);
}

/* ===== LEADERBOARD PAGE ===== */
.lb-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 16px;
}

.lb-title {
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 24px;
}

.lb-filters {
    text-align: center;
    margin-bottom: 20px;
}

.lb-toggle {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 12px;
}

.lb-toggle a {
    padding: 6px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(244,241,255,0.4);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.lb-toggle a.active {
    background: rgba(139,92,246,0.15);
    border-color: #8b5cf6;
    color: #a78bfa;
}

.lb-cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 24px;
}

.lb-cats a {
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    color: rgba(244,241,255,0.35);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
}

.lb-cats a.active {
    background: rgba(139,92,246,0.1);
    border-color: rgba(139,92,246,0.25);
    color: #a78bfa;
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.lb-row:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}

.lb-row.rank-1 {
    background: rgba(251,191,36,0.04);
    border-color: rgba(251,191,36,0.15);
}

.lb-row.rank-2 {
    background: rgba(192,192,192,0.03);
    border-color: rgba(192,192,192,0.1);
}

.lb-row.rank-3 {
    background: rgba(205,127,50,0.03);
    border-color: rgba(205,127,50,0.1);
}

.lb-rank {
    width: 36px;
    text-align: center;
    flex-shrink: 0;
    font-size: 20px;
}

.lb-rank-num {
    font-size: 14px;
    font-weight: 700;
    color: rgba(244,241,255,0.25);
}

.lb-img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.lb-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lb-info {
    flex: 1;
    min-width: 0;
}

.lb-headline {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-meta {
    font-size: 12px;
    color: rgba(244,241,255,0.35);
    margin-top: 2px;
}

.lb-meta a {
    color: rgba(244,241,255,0.45);
    text-decoration: none;
}

.lb-score {
    text-align: right;
    flex-shrink: 0;
}

.lb-stars {
    color: #fbbf24;
    font-size: 14px;
}

.lb-likes {
    font-size: 11px;
    color: rgba(244,241,255,0.25);
    margin-top: 2px;
}

.empty-lb {
    text-align: center;
    padding: 60px 20px;
    color: rgba(244,241,255,0.4);
}

/* ===== VIEW PAGE — share panel & deep analysis ===== */
.share-panel {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.share-card-wrap {
    max-width: 320px;
    margin: 0 auto 12px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.share-card-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.format-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.format-btn {
    padding: 6px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.format-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    color: #a78bfa;
}

.challenge-btn-wrap {
    text-align: center;
    margin-top: 16px;
}

.challenge-btn-wrap .primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
}

/* Deep Analysis */
.deep-analysis-section {
    margin-top: 20px;
}

.deep-analysis-content {
    padding: 20px;
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 16px;
}

.deep-analysis-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 12px;
}

.deep-analysis-content .analysis-text {
    color: rgba(244,241,255,0.8);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
}

.deep-analysis-locked {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.deep-analysis-blur {
    padding: 20px;
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    color: rgba(244,241,255,0.2);
    font-size: 13px;
    line-height: 1.6;
}

.deep-analysis-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10,8,16,0.5);
    backdrop-filter: blur(3px);
    text-align: center;
    padding: 20px;
}

.deep-analysis-overlay h3 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 6px;
}

.deep-analysis-overlay p {
    color: rgba(244,241,255,0.5);
    font-size: 13px;
    max-width: 260px;
    margin-bottom: 16px;
}

.deep-analysis-overlay .primary-btn {
    font-size: 14px;
    padding: 10px 24px;
    width: auto;
}

/* Watermark upsell */
.watermark-upsell {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.watermark-upsell span {
    font-size: 12px;
    color: rgba(244,241,255,0.4);
}

.watermark-upsell a {
    font-size: 12px;
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
}

/* Streak bar */
.streak-bar {
    max-width: 500px;
    margin: 12px auto 0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
}

.streak-bar--risk {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    animation: pulseRisk 2s ease-in-out infinite;
}

.streak-bar--normal {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.12);
}

.streak-icon {
    font-size: 22px;
}

.streak-count {
    font-weight: 700;
    font-size: 14px;
}

.streak-count--risk { color: #ef4444; }
.streak-count--normal { color: #fbbf24; }

.streak-hint {
    font-size: 11px;
}

.streak-hint--risk {
    color: #ef4444;
    font-weight: 600;
}

.streak-hint--normal {
    color: rgba(244,241,255,0.3);
}

/* ===== MOBILE RESPONSIVE — ALL PAGES ===== */
@media (max-width: 600px) {
    /* Battle page */
    .battle-uploads {
        grid-template-columns: 1fr;
    }

    .battle-vs-label {
        margin: 4px 0;
    }

    .battle-grid {
        grid-template-columns: 1fr;
    }

    .battle-vs {
        justify-content: center;
        margin: 8px 0;
    }

    .battle-cta-row {
        flex-direction: column;
        align-items: center;
    }

    .battle-cta-row .primary-btn,
    .battle-cta-row .secondary-btn {
        width: 100%;
        justify-content: center;
    }

    /* Challenge page */
    .vs-grid {
        grid-template-columns: 1fr;
    }

    .vs-text {
        margin: 8px 0;
    }

    .contestant img {
        max-width: 100%;
    }

    /* Leaderboard */
    .lb-row {
        padding: 10px 12px;
        gap: 8px;
    }

    .lb-img {
        width: 42px;
        height: 42px;
    }

    .lb-headline {
        font-size: 13px;
    }

    .lb-stars {
        font-size: 12px;
    }

    /* View page share buttons */
    .share-btns {
        flex-direction: column;
    }

    .share-btns .share-btn {
        justify-content: center;
    }

    .format-btns {
        flex-wrap: wrap;
    }

    .watermark-upsell {
        flex-direction: column;
        text-align: center;
    }

    /* Streak bar */
    .streak-bar {
        margin: 8px 12px 0;
    }
}

@media (max-width: 480px) {
    .battle-page h1,
    .battle-result h1 {
        font-size: 24px;
    }

    .challenge-header h1 {
        font-size: 22px;
    }

    .lb-title {
        font-size: 24px;
    }

    .lb-toggle a {
        padding: 5px 10px;
        font-size: 12px;
    }

    .lb-cats a {
        padding: 3px 8px;
        font-size: 11px;
    }
}
