/* ========================================
   RESPONSIVE MEDIA QUERIES
   ======================================== */

/* Tablets and Small Desktops (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    /* News Grid - 4 Columns to 2 on Tablet */
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }

    /* Advantages Grid - 3 Columns to 2 */
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }

    /* Testimonials Grid - 3 Columns to 2 */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }

    /* Header Navigation */
    .navbar nav ul {
        gap: 1.5rem;
    }

    .navbar nav ul li a {
        font-size: 0.85rem;
    }

    /* Hero Section */
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }

    /* Footer */
    footer .container>div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    /* CRITICAL: Force all grids to single column */
    .news-grid,
    .advantages-grid,
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Header */
    .top-bar {
        padding: 0.5rem 1rem;
    }

    .top-bar .container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .social-media {
        gap: 10px;
    }

    .navbar {
        padding: 0.75rem 0;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .navbar .btn-open-account {
        font-size: 0.8rem;
        padding: 8px 20px;
    }

    /* Hero Section */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.3rem !important;
    }

    p {
        font-size: 1rem !important;
    }

    /* Buttons */
    .btn-cyan,
    .btn-open-account {
        padding: 12px 30px !important;
        font-size: 0.9rem !important;
    }

    /* Two Column Grids to Single Column */
    div[style*="grid-template-columns: 2fr"],
    div[style*="grid-template-columns: 1.8fr"],
    div[style*="grid-template-columns: 1.2fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Stats Section */
    div[style*="display: grid"][style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Footer */
    footer .container>div {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    footer h4 {
        font-size: 1rem !important;
    }

    /* Map Container */
    .map-container {
        height: 300px !important;
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
    }

    /* Footer Social Media - Reduce Gap */
    footer div[style*="display: flex; gap: 1.25rem"] {
        gap: 0.5rem !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
    }
     footer div[style*="display: flex; gap: 1.25rem"] {
        gap: 0.5rem !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
    }
    
    .mobile-auth-buttons {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        position: absolute;
        top: 70px;
        right: 20px;
        z-index: 1000;
        width: 180px;
    }

    .mobile-auth-buttons a {
        white-space: nowrap;
        font-size: 0.85rem !important;
        padding: 10px 18px !important;
    }
}


/* Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    /* Typography */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.2rem !important;
    }

    h4 {
        font-size: 1rem !important;
    }

    p,
    li,
    a {
        font-size: 0.95rem !important;
    }

    /* Header */
    .logo img {
        max-width: 150px !important;
    }

    .top-bar {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .navbar nav ul {
        flex-direction: column;
        gap: 0.75rem;
    }

    .navbar nav ul li a {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    /* Hero Sections */
    section[style*="padding: 6rem"] {
        padding: 3rem 0 !important;
    }

    section[style*="padding: 5rem"] {
        padding: 2.5rem 0 !important;
    }

    section[style*="padding: 4rem"] {
        padding: 2rem 0 !important;
    }

    /* Buttons */
    .btn-cyan,
    .btn-open-account,
    a[class*="btn"] {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
        width: 100%;
        text-align: center;
        display: block;
    }

    /* Flex to Stack */
    div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* All Grids to Single Column */
    div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* News/Analysis Cards */
    .glass-card[style*="border-radius: 24px"] {
        border-radius: 16px !important;
    }

    .glass-card[style*="border-radius: 24px"] div[style*="height: 150px"] {
        height: 180px !important;
    }

    .glass-card[style*="border-radius: 24px"] div[style*="padding: 2.5rem"] {
        padding: 1.5rem !important;
    }

    /* Card Padding */
    .glass-card,
    div[class*="card"] {
        padding: 1.5rem !important;
    }

    /* Partner Banks - Stack on Mobile */
    div[style*="display: flex; justify-content: center; align-items: center"][style*="gap: 5rem"] {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    div[style*="display: flex; justify-content: center; align-items: center"][style*="gap: 5rem"] span {
        font-size: 1.3rem !important;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto !important;
    }

    /* TradingView Widgets */
    .tradingview-widget-container {
        max-width: 100%;
        overflow-x: auto;
    }

    /* Tables */
    table {
        font-size: 0.85rem;
    }

    table th,
    table td {
        padding: 8px 5px !important;
    }

    /* Footer */
    footer {
        font-size: 0.85rem;
    }

    footer .social-media a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    /* Spacing */
    section {
        margin-bottom: 1rem !important;
    }

    /* Economic Calendar Filters */
    div[style*="display: flex; gap"][style*="flex-wrap"] button {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
    }

    /* Stats Numbers */
    div[style*="font-size: 2.5rem"] {
        font-size: 1.75rem !important;
    }

    div[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }
      .mobile-auth-buttons {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        position: absolute;
        top: 70px;
        right: 20px;
        z-index: 1000;
        width: 180px;
    }

    .mobile-auth-buttons a {
        white-space: nowrap;
        font-size: 0.85rem !important;
        padding: 10px 18px !important;
    }
}

/* Very Small Devices (max-width: 320px) */
@media (max-width: 320px) {
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.3rem !important;
    }

    .btn-cyan,
    .btn-open-account {
        padding: 8px 15px !important;
        font-size: 0.8rem !important;
    }

    .container {
        padding: 0 0.75rem;
    }
      .mobile-auth-buttons {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        position: absolute;
        top: 70px;
        right: 20px;
        z-index: 1000;
        width: 180px;
    }

    .mobile-auth-buttons a {
        white-space: nowrap;
        font-size: 0.85rem !important;
        padding: 10px 18px !important;
    }
}

/* Landscape mode for phones */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }

    .navbar {
        padding: 0.5rem 0;
    }

    section {
        padding: 2rem 0 !important;
    }
}

/* Print styles */
@media print {

    .navbar,
    .hero,
    footer,
    .btn-open-account,
    .mobile-menu-toggle {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Increase tap targets */
    button,
    a,
    input,
    select {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    *:hover {
        transform: none !important;
    }
}