/* ============================================
   RESPONSIVE MOBILE STYLES
   Mobile-first approach for all pages
============================================ */

@media (max-width: 768px) {

    /* Header & Navigation */
    header {
        padding: 0.75rem 0;
    }

    .nav-container {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.25rem;
        text-align: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .nav-links {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        font-size: 0.75rem;
    }

    .nav-links li {
        flex: 0 0 auto;
    }

    .nav-links a {
        display: block;
        padding: 0.5rem 0.75rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        white-space: nowrap;
    }

    .auth-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .auth-buttons .btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
        min-width: auto;
    }

    .auth-buttons select {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.75rem !important;
        max-width: 50px !important;
    }

    .lang-switcher {
        order: -1;
    }

    /* Hero Section */
    .hero {
        padding: 100px 0 30px;
        text-align: center;
    }

    .hero h1,
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 0.5rem;
        word-break: break-word;
        max-width: 100%;
        text-align: center;
    }

    .hero .subtitle,
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
        text-align: center;
        letter-spacing: 1px;
    }

    /* Hero Box - Fix overlap */
    .hero-box {
        max-width: 90%;
        padding: 2rem 1.5rem !important;
        margin: 2rem auto;
        position: relative;
    }

    .hero-box h2 {
        font-size: 2.5rem !important;
        word-break: break-word;
        text-align: center;
        line-height: 1.2;
    }

    /* Fix tag positions to not overlap */
    .hero-box .tag-top {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.75rem;
        background: transparent;
    }

    .hero-box .tag-bottom {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        display: block;
        margin-top: 0.5rem;
        font-size: 0.75rem;
        background: transparent;
    }

    /* Buttons in hero */
    .hero>.container>div:first-of-type {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .hero>.container>div:first-of-type .btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
        padding: 0.85rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        padding: 0.65rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* Container */
    .container {
        padding: 0 0.75rem !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* All sections center */
    section {
        text-align: center;
    }

    /* Stats Grid */
    .stats-section {
        padding: 2rem 0 !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        max-width: 360px;
        margin: 0 auto;
    }

    .stat-card {
        padding: 1.25rem;
        text-align: center;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    /* Lookup Container */
    .lookup-container {
        max-width: 360px;
        margin: 2rem auto !important;
        padding: 0 !important;
    }

    .lookup-container h3 {
        font-size: 1rem !important;
        text-align: center;
    }

    .lookup-box {
        height: 50px !important;
        gap: 0.25rem;
        padding: 0.3rem !important;
        width: 100%;
    }

    .lookup-box input {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
    }

    .lookup-box .select-wrapper {
        padding: 0 0.6rem !important;
        height: 40px !important;
        font-size: 0.8rem !important;
    }

    .lookup-box .go-btn {
        width: 40px !important;
        height: 40px !important;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    /* Broker Grid */
    .broker-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        max-width: 360px;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    .morphing-card {
        height: auto;
        min-height: 400px;
        margin: 0 auto;
        width: 100%;
    }

    .card-overlay {
        padding: 1.5rem !important;
    }

    .overlay-content {
        padding: 1rem !important;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .action-buttons .primary-btn,
    .action-buttons .secondary-btn {
        width: 100%;
    }

    /* Container */
    .container {
        padding: 0 0.75rem !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Ecosystem Section */
    .ecosystem-grid {
        grid-template-columns: 1fr !important;
        max-width: 360px;
        margin: 0 auto;
    }

    /* Process Section */
    .process-grid {
        grid-template-columns: 1fr !important;
        max-width: 360px;
        margin: 0 auto;
    }

    /* Footer */
    footer {
        padding: 2rem 0;
        text-align: center;
    }

    footer .container {
        text-align: center;
    }

    /* Posts Grid (News/Guides) */
    .posts-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        max-width: 360px;
        margin: 0 auto;
    }

    .post-thumbnail {
        height: 200px !important;
    }

    /* Article Detail */
    .container-article {
        padding: 2rem 1rem !important;
        max-width: 100%;
    }

    .article-header h1 {
        font-size: 1.75rem !important;
        text-align: center;
    }

    .article-content {
        font-size: 1rem !important;
        text-align: left;
    }

    /* Page Hero */
    .page-hero {
        padding: 4rem 0 2rem !important;
        text-align: center;
    }

    .page-hero h1 {
        font-size: 2rem !important;
        text-align: center;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* Center all headings */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        text-align: center;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .broker-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem !important;
    }

    .page-hero h1 {
        font-size: 1.5rem !important;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}