/* Mobile Styles - Project-Focused Glassmorphic Cards */

/* Hide mobile cards on desktop, show table */
.mobile-cards {
    display: none;
}

/* Show table on desktop */
.leaderboard-container {
    display: block;
}

/* ===== MOBILE BREAKPOINT ===== */
@media (max-width: 768px) {

    /* Compact Header */
    .site-header {
        padding: 0.25rem 0;
    }

    .logo {
        gap: 0.25rem;
        font-size: 1.1rem;
    }

    .logo-text {
        display: none;
    }

    .logo-text-mobile {
        display: block;
        font-size: 0.70rem;
        font-weight: 700;
        color: var(--accent-color);
        white-space: nowrap;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }


    .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        margin-left: 0;
        /* Reset margin since we use gap in nav-actions */
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .login-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* ===== CRITICAL: Fix Grid Layout for Mobile ===== */
    .grid-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .mobile-hidden {
        display: none !important;
    }

    /* Fix main content positioning */
    .main-content {
        margin-top: 0;
        padding-top: 0;
        padding-bottom: 2rem;
    }

    /* Hero section mobile optimization */
    .hero-section {
        text-align: center;
        margin-top: 0.5rem;
        /* Very compact margin */
        padding: 0 1rem;
        /* Ensure padding */
        min-height: auto;
        /* Reset any min-height */
        display: block;
        /* Reset flex */
    }

    .desktop-hero-content {
        display: none;
    }

    .mobile-hero-content {
        display: block;
        margin-bottom: 1.5rem;
    }

    .mobile-hero-title {
        font-size: 1.5rem;
        /* Readable but compact */
        line-height: 1.2;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
        letter-spacing: -0.02em;
    }

    /* Existing desktop hero styles hidden via .desktop-hero-content */

    /* Trust features compact on mobile */
    .trust-features {
        gap: 1rem;
        align-items: center;
    }

    .feature {
        max-width: 100%;
    }

    .feature-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .feature-text h3 {
        font-size: 0.9rem;
    }

    .feature-text p {
        font-size: 0.8rem;
    }

    /* Registration card mobile */
    .registration-card {
        padding: 1.25rem;
        margin-top: 0;
        border-radius: 1rem;
    }

    .card-header h2 {
        font-size: 1.35rem;
    }

    .card-header p {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 0.875rem;
    }

    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .card-footer {
        margin-top: 1rem;
    }

    /* Hide table/list on mobile */
    .leaderboard-container,
    .desktop-projects-container {
        display: none;
    }

    /* Show mobile cards */
    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0;
        margin-bottom: 2rem;
    }

    /* Loading & Error States */
    .mobile-loading,
    .mobile-empty,
    .mobile-error {
        text-align: center;
        padding: 3rem 1rem;
        color: var(--text-secondary);
        font-size: 1rem;
    }

    .mobile-error {
        color: var(--error-color);
    }

    /* Leaderboard hero */
    .leaderboard-hero {
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
    }

    /* ===== GLASSMORPHIC PROJECT CARD ===== */
    .project-card {
        position: relative;
        display: grid;
        grid-template-columns: auto 1fr;
        /* Rank + Content (Chart is absolute) */
        column-gap: 0.5rem;
        /* Tighter gap */
        align-items: center;
        /* Vertical center for rank */
        padding: 0.5rem 0.75rem;
        /* Minimal padding */
        border-radius: 12px;
        background: rgba(15, 23, 42, 0.7);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(148, 163, 184, 0.15);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        animation: cardSlideIn 0.5s ease-out both;
        overflow: visible;
        min-height: auto;
    }

    /* Card slide-in animation */
    @keyframes cardSlideIn {
        from {
            opacity: 0;
            transform: translateY(10px) scale(0.98);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* ===== RANK BADGE ===== */
    .card-rank {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        font-weight: 700;
        border-radius: 8px;
        background: rgba(148, 163, 184, 0.1);
        color: var(--text-secondary);
        z-index: 1;
    }

    /* Gold rank */
    .card-rank.gold {
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
        color: #1a1a1a;
        box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
    }

    /* Silver rank */
    .card-rank.silver {
        background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
        color: #1a1a1a;
        box-shadow: 0 2px 8px rgba(148, 163, 184, 0.3);
    }

    /* Bronze rank */
    .card-rank.bronze {
        background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
    }

    /* ===== CARD LOGO (Replaces Rank) ===== */
    .card-logo {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        /* Matching the rank radius or slightly rounded */
        overflow: hidden;
        background: rgba(148, 163, 184, 0.1);
        /* Fallback bg */
        z-index: 1;
    }

    .mobile-project-logo {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* ===== CARD CONTENT ===== */
    .card-content {
        min-width: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0.15rem;
    }

    .card-project-name {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 0.05rem;
        /* Tighten */
    }

    .card-founder {
        font-size: 0.75rem;
        color: var(--text-secondary);
        margin-bottom: 0.15rem;
        line-height: 1.1;
    }

    /* ===== METRICS ROW ===== */
    .card-metrics {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: 0.1rem;
        width: 100%;
        position: relative;
        z-index: 2;
        /* Ensure text is above chart if they overlap */
    }

    .card-revenue {
        display: flex;
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }

    .metric-label {
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-secondary);
        opacity: 0.7;
    }

    .metric-value {
        font-family: 'Inter', system-ui, -apple-system, sans-serif;
        font-size: 0.9rem;
        /* Reduced size significantly */
        font-weight: 700;
        letter-spacing: -0.01em;
        font-feature-settings: "tnum" on, "lnum" on;
        white-space: nowrap;
        line-height: 1;
        /* Tighten line height */
    }

    .card-revenue .metric-value {
        color: var(--success-color);
        background: none;
        -webkit-text-fill-color: initial;
    }

    .card-mrr {
        display: flex;
        position: absolute;
        right: 0.5rem;
        bottom: 0.5rem;
        width: 160px;
        justify-content: flex-start;
        align-items: baseline;
        gap: 0.35rem;
        z-index: 2;
    }

    .card-mrr .metric-label {
        display: block;
        font-size: 0.65rem;
        font-weight: 700;
        color: #ef4444;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .card-mrr .metric-value {
        color: #ef4444;
        font-size: 0.8rem;
        font-weight: 600;
    }

    /* ===== SPARKLINE CHART ===== */
    .card-chart {
        position: absolute;
        right: 0.5rem;
        top: 0.5rem;
        width: 160px;
        /* Restored size */
        height: 60%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        opacity: 0.5;
        /* Lower opacity so numbers are readable over it */
        z-index: 0;
        /* Behind text */
        pointer-events: none;
        transform: translateY(-2px);
    }

    /* ===== FOOTER - CLEAN & COMPACT ===== */
    .site-footer {
        padding: 0.5rem 0;
        margin-top: auto;
    }

    .site-footer .container {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        text-align: center;
    }

    .site-footer p {
        font-size: 0.75rem;
        margin: 0;
        white-space: nowrap;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .footer-links a {
        font-size: 0.8rem;
    }
}

/* ===== SMALL MOBILE (< 600px) ===== */
@media (max-width: 600px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .project-card {
        padding: 1rem;
    }

    .card-rank {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .card-project-name {
        font-size: 1.05rem;
    }

    .registration-card {
        padding: 1rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.5rem 0.75rem;
    }
}

/* ===== TABLET ADJUSTMENTS (600-768px) ===== */
@media (min-width: 601px) and (max-width: 768px) {
    .project-card {
        padding: 1.5rem;
    }

    .card-metrics {
        gap: 2rem;
    }

    .registration-card {
        padding: 1.5rem;
    }
}

/* ===== RESPONSIVE GRID (769-900px) ===== */
@media (max-width: 900px) and (min-width: 769px) {
    .grid-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .hero-section {
        text-align: center;
    }

    .hero-description {
        margin: 0 auto var(--spacing-lg) auto;
    }

    .trust-features {
        align-items: center;
        text-align: left;
    }

    .feature {
        max-width: 400px;
    }
}

/* ===== MOBILE REGISTRATION SPECIFIC ===== */
@media (max-width: 768px) {

    /* Reorder Grid Layout */
    .grid-layout {
        display: flex;
        flex-direction: column;
    }

    .form-section {
        order: -1;
        margin-bottom: 3rem;
        /* Increased spacing */
    }

    .hero-section {
        order: 2;
        margin-top: 0;
        padding-bottom: 4rem;
        text-align: center;
        position: relative;
    }

    /* Visual Separator */
    .hero-section::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border-color);
        margin: 0 auto 2.5rem auto;
        border-radius: 2px;
        opacity: 0.3;
    }

    /* Premium Title Styling */
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
        font-weight: 800;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }

    /* Gradient Highlight */
    .hero-title .highlight {
        background: linear-gradient(135deg, var(--accent-color) 0%, #a855f7 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        /* Disable the underline from main styles to keep it clean */
        text-decoration: none;
    }

    .hero-title .highlight::after {
        display: none;
    }

    .hero-description {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--text-secondary);
        margin-bottom: 2.5rem;
        padding: 0 0.5rem;
        opacity: 0.9;
    }

    /* Glassmorphic Registration Card */
    .registration-card {
        background: rgba(15, 23, 42, 0.7);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(148, 163, 184, 0.15);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        padding: 1.5rem;
        border-radius: 20px;
        /* Slightly more rounded */
    }

    /* Input Fields Optimization */
    .form-group input,
    .form-group select {
        background: rgba(248, 250, 252, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.2);
        font-size: 16px;
        /* Prevent zooming on iOS */
        padding: 0.75rem 1rem;
    }

    .form-group input:focus,
    .form-group select:focus {
        background: #ffffff;
        border-color: var(--accent-color);
    }

    /* Trust Features as Premium Cards */
    .trust-features {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }

    .feature {
        background: rgba(15, 23, 42, 0.4);
        border: 1px solid rgba(148, 163, 184, 0.08);
        border-radius: 16px;
        padding: 1.25rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        max-width: 100%;
        /* Reset desktop max-width */
    }

    .feature-icon {
        flex-shrink: 0;
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        background: rgba(96, 165, 250, 0.1);
        /* Subtle tint */
        border-radius: 12px;
        color: var(--accent-color);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .feature-text h3 {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
    }

    .feature-text p {
        font-size: 0.9rem;
        line-height: 1.45;
        color: var(--text-secondary);
        margin: 0;
    }

    /* ===== PRICING PAGE MOBILE ===== */
    .pricing-page {
        padding-top: 0.5rem;
    }

    .pricing-hero {
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }

    .pricing-hero .hero-title {
        font-size: 1.75rem;
    }

    .pricing-hero .hero-description {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    .billing-toggle {
        margin-bottom: 2rem;
        gap: 0.75rem;
    }

    .toggle-label {
        font-size: 0.85rem;
    }

    .toggle-switch {
        width: 48px;
        height: 24px;
    }

    .toggle-slider::before {
        width: 18px;
        height: 18px;
    }

    .toggle-switch input:checked+.toggle-slider::before {
        transform: translateX(24px);
    }

    .pricing-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .pricing-card {
        padding: 2rem 1.5rem;
    }

    .plan-name {
        font-size: 1.5rem;
    }

    .price-amount {
        font-size: 2.5rem;
    }

    .price-currency {
        font-size: 1.25rem;
    }

    .plan-features li {
        font-size: 0.9rem;
    }

    .buy-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .delivery-info {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1rem;
        margin: 0 0.5rem 1.5rem;
    }

    .info-icon {
        margin: 0 auto;
    }

    .payment-notice {
        padding: 0.75rem 0.5rem;
    }

    .payment-notice p {
        font-size: 0.8rem;
    }
}