/* ============================================
   SADEE JODI — Responsive Styles
   Mobile First Breakpoints
   ============================================ */

/* Global overflow fix */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ---- Tablets & Below (max: 1024px) ---- */
@media screen and (max-width: 1024px) {
    :root {
        --fs-6xl: 3rem;
        --fs-5xl: 2.5rem;
        --fs-4xl: 2.2rem;
        --fs-3xl: 1.8rem;
    }

    .container {
        padding: 0 var(--space-md);
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 2;
    }

    .hero-subtitle {
        margin: 0 auto var(--space-2xl);
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-image-wrapper {
        width: 350px;
        height: 420px;
    }

    .hero-float-card.card-match {
        right: -10px;
        top: 5%;
    }

    .hero-float-card.card-verified {
        left: -10px;
    }

    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }

    .steps-grid::before {
        display: none;
    }

    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }

    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }

    .plan-card.popular {
        transform: scale(1.02);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }

    .search-widget {
        flex-wrap: wrap;
    }

    .search-widget .search-field {
        flex: 1 1 calc(50% - var(--space-lg));
        min-width: 200px;
    }

    /* Navbar */
    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 80px var(--space-xl) var(--space-xl);
        gap: var(--space-lg);
        transition: right var(--transition-base);
        border-left: 1px solid var(--border-color);
        z-index: var(--z-fixed);
    }

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

    .navbar-toggle {
        display: flex;
        z-index: calc(var(--z-fixed) + 1);
    }

    .navbar-actions.desktop-auth {
        display: none;
    }

    .navbar-actions {
        flex-direction: column;
        width: 100%;
    }

    .navbar-actions .btn {
        width: 100%;
    }

    .scroll-progress {
        display: none !important;
    }
}

/* ---- Mobile Landscape & Below (max: 768px) ---- */
@media screen and (max-width: 768px) {
    :root {
        --fs-6xl: 2.5rem;
        --fs-5xl: 2rem;
        --fs-4xl: 1.75rem;
        --fs-3xl: 1.5rem;
        --fs-2xl: 1.25rem;
    }

    .section {
        padding: var(--space-3xl) 0;
    }

    .section-header {
        margin-bottom: var(--space-2xl);
    }

    .hero {
        min-height: auto;
        padding: 90px 0 20px;
    }

    .hero .container {
        gap: var(--space-xl);
    }

    .hero-content {
        order: 1 !important;
    }

    .hero-visual {
        order: 2 !important;
    }

    .hero-image-wrapper {
        width: 240px;
        height: 300px;
        margin: 0 auto;
    }

    .hero-float-card {
        display: none !important;
    }

    .hero-orbital {
        display: none;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        max-width: 400px;
        margin: 0 auto;
    }

    .stories-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 380px;
        margin: 0 auto;
    }

    .plan-card.popular {
        transform: none;
    }

    .plan-card.popular:hover {
        transform: translateY(-8px);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-widget {
        flex-direction: column;
        padding: var(--space-lg);
    }

    .search-widget .search-field {
        width: 100%;
        flex: auto;
        min-width: auto;
    }

    .search-widget .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cta-wrapper {
        padding: var(--space-2xl);
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .profile-card {
        min-width: 260px;
    }

    /* Carousel nav */
    .carousel-nav {
        justify-content: center;
    }

    /* Typewriter mobile */
    .typewriter-title {
        justify-content: center;
    }

    /* Modal */
    .modal {
        width: 95%;
        padding: var(--space-xl);
    }

    /* Toast */
    .toast-container {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 20px;
    }

    .toast {
        min-width: auto;
    }
}

/* ---- Small Phones (max: 480px) ---- */
@media screen and (max-width: 480px) {
    :root {
        --fs-6xl: 1.75rem;
        --fs-5xl: 1.5rem;
        --fs-4xl: 1.35rem;
    }

    .container {
        padding: 0 var(--space-md);
        max-width: 100%;
    }

    .hero {
        padding: 80px 0 16px;
    }

    .hero-title {
        font-size: 1.65rem !important;
    }

    .hero-subtitle {
        font-size: var(--fs-sm) !important;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-md);
        justify-content: center;
    }

    .hero-stat {
        flex: 0 0 auto;
    }

    .hero-image-wrapper {
        width: 200px;
        height: 250px;
    }

    .search-widget {
        margin: 0;
        border-radius: var(--border-radius-lg);
    }

    /* Fix CTA buttons wrapping */
    .flex.gap-md.justify-center {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
    }

    .stat-item .stat-count {
        font-size: var(--fs-3xl);
    }

    .step-card .step-icon {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }

    .navbar-menu {
        width: 100%;
    }

    .profile-card {
        min-width: 240px;
    }

    .plan-card {
        padding: var(--space-xl);
    }

    .cta-wrapper {
        padding: var(--space-xl);
    }

    .cta-wrapper h2 {
        font-size: var(--fs-xl);
    }

    h1 { font-size: var(--fs-3xl); }
    h2 { font-size: var(--fs-2xl); }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION BAR
   Shown on screens ≤ 768px for logged-in pages
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 12px;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    transition: all 0.3s ease;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary);
}

.mobile-bottom-nav .nav-item.active i {
    transform: translateY(-2px);
}

.mobile-bottom-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 3px 3px;
}

.mobile-bottom-nav .nav-item:hover {
    color: var(--primary);
}

/* Notification badge on nav item */
.mobile-bottom-nav .nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(10, 10, 20, 0.95);
}

/* Light theme */
[data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mobile-bottom-nav .nav-item {
    color: var(--text-muted);
}

[data-theme="light"] .mobile-bottom-nav .nav-item.active {
    color: var(--primary);
}

[data-theme="light"] .mobile-bottom-nav .nav-item .nav-badge {
    border-color: rgba(255, 255, 255, 0.95);
}

@media screen and (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* Add padding at bottom so content doesn't hide behind navbar */
    body.has-bottom-nav {
        padding-bottom: 72px;
    }

    /* Hide desktop navbar on pages with bottom nav */
    body.has-bottom-nav .navbar-menu .mobile-auth {
        display: none;
    }
}

/* ============================================
   SKELETON LOADER CARDS
   Perceived speed enhancement
   ============================================ */
.skeleton-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    overflow: hidden;
}

.skeleton-card .skeleton-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: var(--space-md);
}

.skeleton-card .skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: var(--space-sm);
}

.skeleton-card .skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-card .skeleton-line.short {
    width: 60%;
}

.skeleton-card .skeleton-line.medium {
    width: 80%;
}

.skeleton-card .skeleton-img {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius-md);
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: var(--space-md);
}

/* Profile card skeleton */
.skeleton-profile-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.skeleton-profile-card .skeleton-profile-img {
    width: 100%;
    height: 280px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-profile-card .skeleton-profile-info {
    padding: var(--space-lg);
}

.skeleton-profile-card .skeleton-profile-name {
    height: 20px;
    width: 65%;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: var(--space-sm);
}

.skeleton-profile-card .skeleton-profile-detail {
    height: 14px;
    width: 80%;
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: var(--space-xs);
}

/* Grid of skeleton cards */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-xl);
}

/* Light theme skeletons */
[data-theme="light"] .skeleton-card {
    background: #FFFFFF;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .skeleton-card .skeleton-avatar,
[data-theme="light"] .skeleton-card .skeleton-line,
[data-theme="light"] .skeleton-card .skeleton-img,
[data-theme="light"] .skeleton-profile-card .skeleton-profile-img,
[data-theme="light"] .skeleton-profile-card .skeleton-profile-name,
[data-theme="light"] .skeleton-profile-card .skeleton-profile-detail {
    background: linear-gradient(90deg, #F0EDF5 25%, #E8E5EE 50%, #F0EDF5 75%);
    background-size: 200% 100%;
}

[data-theme="light"] .skeleton-profile-card {
    background: #FFFFFF;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* Swipe Card Wrapper (for future Tinder-like swipe) */
.swipe-card-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    touch-action: pan-y;
}

.swipe-card {
    position: relative;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: grab;
}

.swipe-card:active {
    cursor: grabbing;
}

.swipe-card .swipe-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
}

.swipe-card .swipe-info {
    padding: var(--space-xl);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.swipe-card .swipe-name {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: #fff;
}

.swipe-card .swipe-details {
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.8);
    margin-top: var(--space-xs);
}

.swipe-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.swipe-actions .swipe-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
}

.swipe-actions .swipe-btn.skip {
    border-color: var(--error);
    color: var(--error);
}

.swipe-actions .swipe-btn.skip:hover {
    background: var(--error);
    color: #fff;
    transform: scale(1.1);
}

.swipe-actions .swipe-btn.like {
    border-color: var(--success);
    color: var(--success);
}

.swipe-actions .swipe-btn.like:hover {
    background: var(--success);
    color: #fff;
    transform: scale(1.1);
}

.swipe-actions .swipe-btn.super {
    border-color: var(--secondary);
    color: var(--secondary);
}

.swipe-actions .swipe-btn.super:hover {
    background: var(--secondary);
    color: #fff;
    transform: scale(1.1);
}

/* ---- Large Screens (min: 1400px) ---- */
@media screen and (min-width: 1400px) {
    .container {
        max-width: var(--container-2xl);
    }

    .hero-image-wrapper {
        width: 500px;
        height: 600px;
    }
}
