/* ============================================
   RESPONSIVE - Mobile & Tablet Optimizations
   ============================================ */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }

    .card {
        padding: 20px;
    }

    .modal-content {
        width: 95%;
        padding: 24px;
    }
}

/* Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 16px;
    }

    /* Navigation */
    .nav {
        flex-direction: column;
        gap: 12px;
    }

    .nav-item {
        width: 100%;
        text-align: center;
    }

    /* Buttons */
    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
    }

    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .card-header {
        font-size: 18px;
    }

    /* Forms */
    .form-control {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 16px;
    }

    .modal-header {
        font-size: 20px;
    }

    /* Tables */
    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 12px;
    }

    /* Hide table on very small screens, show cards instead */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Trading Grid */
    .trading-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Header */
    .header {
        padding: 16px;
    }

    .header h1 {
        font-size: 24px;
    }

    /* Footer */
    .footer {
        padding: 16px;
        font-size: 12px;
    }
}

/* Small Mobile (max-width: 480px) */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 0 12px;
    }

    .card {
        padding: 12px;
    }

    .card-header {
        font-size: 16px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .modal-content {
        padding: 16px;
    }

    .modal-header {
        font-size: 18px;
    }

    .table {
        font-size: 11px;
    }

    .table th,
    .table td {
        padding: 6px 8px;
    }

    .header h1 {
        font-size: 20px;
    }
}

/* Landscape Mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    .header {
        padding: 12px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print Styles */
@media print {
    .no-print,
    .btn,
    .nav,
    .modal,
    .alert {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: white;
    }
}

/* Utilities for Responsive */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: block;
    }
}

/* Flex utilities for responsive layouts */
.flex-mobile-column {
    display: flex;
}

@media screen and (max-width: 768px) {
    .flex-mobile-column {
        flex-direction: column;
    }
}
