/* Mobile Optimization Styles - Responsive Design */

/* TABLET BREAKPOINT (768px and below) */
@media (max-width: 768px) {
    /* Hero Section with top padding to prevent header overlap */
    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .hero {
        padding: 2rem 0 !important;
        margin-top: 150px;
    }

    section.hero {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Mission Grid */
    .mission-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* 3-Column Grid */
    .grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    /* Pricing Grid - Hide scale effect on tablet */
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .pricing-grid > div {
        transform: scale(1) !important;
    }

    .pricing-grid > div[style*="scale(1.05)"] {
        transform: scale(1) !important;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.6rem !important;
    }

    h3 {
        font-size: 1.3rem !important;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        padding: 0.75rem 1.5rem !important;
        text-align: center !important;
        display: block !important;
    }

    /* Navigation */
    .nav-menu {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem;
        position: static;
        width: 100%;
        background: white;
        padding: 1rem 0;
        margin-top: 0.5rem;
    }

    .nav-menu li {
        display: block !important;
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.5rem 0;
        font-size: 0.9rem;
        border-bottom: 1px solid #f3f4f6;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .navbar {
        flex-wrap: wrap;
        gap: 0;
    }

    .currency-dropdown {
        width: 100%;
        margin-top: 0.5rem;
        margin-right: 0 !important;
    }

    .currency-btn {
        width: 100%;
        justify-content: flex-start;
        border-top: 1px solid #f3f4f6;
        border-radius: 0;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Cards and containers */
    .product-category {
        padding: 1.5rem !important;
    }

    /* Pricing cards */
    .pricing-card {
        padding: 1.5rem !important;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Spacing adjustments */
    .container {
        padding: 1rem !important;
    }

    /* Text sizing */
    p {
        font-size: 0.95rem !important;
    }

    /* Table adjustments */
    table {
        font-size: 0.85rem !important;
    }

    td, th {
        padding: 0.5rem !important;
    }

    /* Hero Section Optimization */
    .hero-grid > div:first-child {
        width: 100%;
        margin-bottom: 0.75rem;
        order: -1;
    }

    .hero-grid > div:last-child {
        width: 100%;
    }

    .hero-grid > div:last-child h1 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.2 !important;
    }

    .hero-grid > div:last-child p {
        font-size: 0.95rem !important;
        margin-bottom: 0.75rem !important;
    }

    .hero-grid > div > div {
        height: 280px !important;
        border-radius: 16px !important;
    }

    .hero-grid > div img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Mission Grid Images */
    .mission-grid > div:first-child {
        order: 2;
    }

    .mission-grid > div:first-child h2 {
        font-size: 1.6rem !important;
        margin-bottom: 1rem !important;
    }

    .mission-grid > div:first-child p {
        font-size: 0.95rem !important;
    }

    .mission-grid > div:last-child {
        order: 1;
        text-align: center;
        margin-bottom: 1rem;
    }

    .mission-grid > div:last-child > div {
        height: 260px !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .mission-grid img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }

    /* Reduced padding on sections */
    section {
        padding: 2rem 1rem !important;
    }

    /* Pricing card icons */
    .pricing-grid > div > div:first-child {
        font-size: 2rem !important;
    }

    /* Pricing card heading */
    .pricing-grid > div h3 {
        font-size: 1.3rem !important;
    }

    /* Pricing card price */
    .pricing-grid > div .price {
        font-size: 2rem !important;
    }

    /* Popular badge repositioning */
    .pricing-grid > div[style*="absolute"] {
        top: -15px !important;
    }
}

/* MOBILE BREAKPOINT (480px and below) */
@media (max-width: 480px) {
    .hero-grid > div:last-child h1 {
        font-size: 1.5rem !important;
    }

    .hero-grid > div > div {
        height: 240px !important;
        border-radius: 14px !important;
    }

    .mission-grid > div:first-child h2 {
        font-size: 1.4rem !important;
    }

    .mission-grid > div:last-child > div {
        height: 220px !important;
    }
@media (max-width: 480px) {
    /* Hero Section */
    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .pricing-grid > div {
        padding: 1.25rem !important;
        transform: scale(1) !important;
    }

    .pricing-grid > div[style*="absolute"] {
        top: -12px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    /* Typography */
    h1 {
        font-size: 1.4rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }

    h2 {
        font-size: 1.3rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.9rem !important;
    }

    /* Input font size for iOS */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Grid adjustments */
    .grid-3 {
        grid-template-columns: 1fr !important;
    }

    /* Navigation */
    .nav-menu li {
        display: block !important;
    }

    .nav-menu {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-bottom: 1px solid #f3f4f6;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* Header adjustments */
    .header {
        padding: 0.75rem 0 !important;
    }

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

    .logo {
        font-size: 1.3rem !important;
        margin-bottom: 0.5rem;
        width: 100%;
    }

    .nav-buttons {
        width: 100%;
        margin-top: 0.5rem;
        border-top: 1px solid #f3f4f6;
        padding-top: 0.5rem;
    }

    .currency-dropdown {
        width: 100%;
        margin-right: 0 !important;
        margin-top: 0.5rem;
    }

    .currency-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 0.5rem 1rem !important;
        border-radius: 0;
        border-top: 1px solid #f3f4f6;
        font-size: 0.8rem !important;
    }

    .currency-menu {
        width: 100% !important;
        position: static;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        padding: 0.5rem 0;
        background: #f9fafb;
        margin-top: 0.25rem;
    }

    .currency-menu.show {
        display: block;
    }

    .currency-item {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Footer */
    .footer-content {
        gap: 1.5rem !important;
    }

    .footer-section {
        padding: 0 !important;
    }

    .footer-section h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Cards */
    .product-category {
        padding: 1.25rem !important;
        border-radius: 12px !important;
    }

    /* Reduced spacing */
    .container {
        padding: 0.75rem !important;
    }

    /* Section padding */
    section {
        padding: 1.5rem 0.75rem !important;
    }

    /* Image adjustments */
    .hero > div > div {
        height: 250px !important;
    }

    .mission-grid img {
        height: 220px !important;
    }

    /* BRVM Ticker */
    .bar1 {
        padding: 0.5rem 0 !important;
    }

    .brvm-tables {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .brvm-tables > div {
        flex: 1 !important;
    }

    .brvm-indices-grid {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: flex-start !important;
    }

    .brvm-indices-grid > div {
        width: 100% !important;
        flex-wrap: wrap !important;
    }

    .bar11 {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tblp {
        font-size: 0.8rem !important;
    }

    .tblp td, .tblp th {
        padding: 0.35rem !important;
    }

    .bar121 {
        margin-bottom: 8px !important;
    }

    .bar121 span {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }

    .bar121 i {
        font-size: 12px !important;
    }

    /* Pricing cards */
    .pricing-grid > div {
        padding: 1.25rem !important;
        position: relative;
    }

    .pricing-grid > div > div:first-child {
        font-size: 2rem !important;
        margin-bottom: 0.75rem !important;
    }

    .pricing-grid > div h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .pricing-grid > div .price {
        font-size: 1.8rem !important;
    }

    .pricing-grid > div ul li {
        padding: 0.35rem 0 !important;
        font-size: 0.85rem !important;
    }

    .pricing-grid > div ul li i {
        margin-right: 0.35rem !important;
        font-size: 0.9rem !important;
    }

    /* BRVM Ticker - Mobile */
    .brvm-banner {
        padding: 0.5rem 0 !important;
    }

    .brvm-tables {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .brvm-tables > div {
        flex: 1 !important;
    }

    .bar11 {
        flex-direction: column;
        gap: 0.35rem;
    }

    .bar11 a {
        font-size: 12px !important;
        flex-wrap: wrap;
    }

    .bar11 span:first-child {
        width: 14px !important;
        height: 10px !important;
    }

    .bar121 {
        margin-bottom: 6px !important;
    }

    .bar121 span {
        font-size: 10px !important;
        padding: 3px 6px !important;
        gap: 4px !important;
    }

    .bar121 i {
        font-size: 11px !important;
    }

    .tblp {
        font-size: 0.75rem !important;
        width: 100% !important;
    }

    .tblp td {
        padding: 2px 4px !important;
    }

    .tblp tr {
        display: flex;
        justify-content: space-between;
        padding: 0.25rem 0 !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    }

    .tblp td:nth-child(1) {
        flex: 0.5;
    }

    .tblp td:nth-child(2) {
        flex: 0.3;
        text-align: center;
    }

    .tblp td:nth-child(3) {
        flex: 0.7;
        text-align: right;
    }

    .tblp td:nth-child(4) {
        flex: 0.5;
        text-align: right;
    }

    /* Indices grid - Vertical stacking */
    .brvm-indices {
        padding: 0.75rem 0 !important;
    }

    .brvm-indices-grid {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
    }

    .brvm-indices-grid > div {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.5rem 0 !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    }

    .brvm-indices-grid > div:last-child {
        border-bottom: none;
    }

    .barq1, .barq2, .barq3, .barq4 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
        width: 100%;
    }

    .barq1 span:first-child,
    .barq2 span:first-child,
    .barq3 span:first-child,
    .barq4 span:first-child {
        width: 12px !important;
        height: 8px !important;
        margin-right: 0.5rem !important;
    }

    .barq1 span:nth-child(2),
    .barq2 span:nth-child(2),
    .barq3 span:nth-child(2),
    .barq4 span:nth-child(2) {
        font-size: 11px !important;
        flex: 1;
    }

    .mobno {
        font-size: 11px !important;
        margin-left: 0.5rem !important;
    }

    .quote_down2, .quote_up2 {
        font-size: 11px !important;
        margin-left: 0.5rem !important;
    }

    /* Hero text spacing */
    .hero-grid h1 {
        margin-bottom: 0.5rem !important;
    }

    .hero-grid p {
        margin-bottom: 1rem !important;
    }

    /* Currency dropdown */
    .currency-dropdown {
        margin-right: 0 !important;
    }

    .currency-btn {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .currency-menu {
        min-width: 140px !important;
    }

    /* User menu */
    .user-menu {
        flex-direction: column;
        gap: 0.25rem;
    }

    .user-greeting {
        font-size: 0.7rem !important;
    }

    .btn-logout {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.75rem !important;
    }

    /* Pricing popular badge text */
    .pricing-grid > div[style*="background: #10b981"] {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.75rem !important;
    }

    /* Adjust pricing card border on mobile */
    .pricing-grid > div {
        border-radius: 16px !important;
    }

    /* List items in pricing */
    .pricing-grid > div ul {
        margin-bottom: 1rem !important;
    }
}

/* TOUCH OPTIMIZATION - Larger click targets */
@media (hover: none) and (pointer: coarse) {
    button,
    a.btn-primary,
    a.btn-secondary,
    .currency-item,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    /* Remove hover effects on touch devices */
    button:hover,
    a:hover {
        background: inherit;
    }

    /* Use active state instead */
    button:active,
    a:active {
        opacity: 0.8;
        transform: scale(0.98);
    }

    /* Links should be easier to tap */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ACCESSIBILITY - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1f2937;
        color: #f3f4f6;
    }

    .currency-btn {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .currency-btn:hover {
        background: #4b5563;
        border-color: #6b7280;
    }

    .currency-menu {
        background: #374151;
        border-color: #4b5563;
    }

    .currency-item {
        color: #f3f4f6;
    }

    .currency-item:hover {
        background: #4b5563;
    }

    .currency-item.active {
        background: #7f1d1d;
    }

    .currency-name {
        color: #d1d5db;
    }

    .currency-item.active .currency-name {
        color: #fca5a5;
    }

    /* Pricing cards dark mode */
    .pricing-grid > div {
        background: #2d3748 !important;
        color: #f3f4f6;
    }

    .pricing-grid > div h3 {
        color: #f3f4f6 !important;
    }

    .pricing-grid > div p {
        color: #d1d5db !important;
    }
}

/* LANDSCAPE ORIENTATION */
@media (max-height: 500px) and (orientation: landscape) {
    .hero > div > div {
        height: 200px !important;
    }

    .mission-grid img {
        height: 180px !important;
    }

    h1 {
        font-size: 1.3rem !important;
    }

    section {
        padding: 1rem 0.75rem !important;
    }

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

/* PRINT STYLES */
@media print {
    .header,
    .footer,
    .currency-dropdown,
    .nav-buttons,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}
