@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary-color: #00d4ff;
    --primary-dark: #0099cc;
    --primary-light: #00e8ff;
    --secondary-color: #0099aa;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252d3d;
    --bg-hover: #2d3a4d;

    --text-primary: #ffffff;
    --text-secondary: #b4bcc4;
    --text-muted: #8a919a;

    --border-color: #3a4556;
    --border-light: #2a3240;

    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-dark: linear-gradient(135deg, #1a1f2e 0%, #252d3d 100%);

    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Scrollbar styling - Hidden */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

p, label, small {
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

/* Navbar */
.navbar-modern {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.05);
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--text-primary) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-toggler {
    border-color: var(--border-color);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 212, 255, 0.25);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-wallet {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 100%;
}

.btn-wallet:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
}

/* Forms */
.form-control, .form-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 212, 255, 0.25);
}

.form-control-modern {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-control-modern::placeholder {
    color: var(--text-muted);
}

.form-select-modern {
    background: var(--bg-tertiary) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2300d4ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    border-color: var(--border-color);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-range {
    height: 6px;
}

.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
    border: 3px solid var(--bg-primary);
}

.form-check-input {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
}

.card-modern {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
}

/* Layout */
.main-container {
    display: flex;
    min-height: 100vh;

    gap: 0;
}

.sidebar-left {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem;
    max-height: calc(100vh - 60px);
}

.sidebar-left.collapsed {
    width: 60px;
    padding: 1rem 0.5rem;
}

.sidebar-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.sidebar-menu, .sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-right {
    width: 300px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem;
    max-height: calc(100vh - 60px);
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

/* Token Header */
.token-header {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gradient-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.token-pair {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Order Book */
.order-book {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.order-section h6 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* Sell & Buy orders - styled and sized for mobile (moved to media query) */

/* Wallet Info */
.wallet-balance, .token-info {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
}

.wallet-balance:first-child, .token-info:first-child {
    border-top: none;
    margin-top: 0;
}

/* Accordion */
.accordion-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.accordion-button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
}

.accordion-button:not(.collapsed) {
    background: var(--bg-hover);
    box-shadow: none;
    border-color: var(--border-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 212, 255, 0.25);
    border-color: var(--primary-color);
}

.accordion-collapse {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* Modal */
.modal-modern {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.modal-modern .modal-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-modern .modal-body {
    background: var(--bg-secondary);
}

.modal-modern .btn-close {
    filter: invert(1) brightness(200%);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Tables */
.table {
    color: var(--text-secondary);
}

.table thead {
    border-bottom: 2px solid var(--border-color);
}

.table th {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    border-bottom: 1px solid var(--border-light);
}

.table-modern tbody tr:hover {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.bg-primary {
    background: var(--primary-color) !important;
    color: var(--bg-primary);
}

.badge.bg-success {
    background: var(--success-color) !important;
}

.badge.bg-danger {
    background: var(--danger-color) !important;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 0.75rem 1rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #86efac;
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.fw-bold {
    font-weight: 700;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Input Groups */
.input-group-text {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.input-group-prepend .input-group-text,
.input-group-append .input-group-text {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

/* Mobile Responsiveness - Apply until 1200px width */
@media (max-width: 1199px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar-left, .sidebar-right {
        display: none;

    }

    .main-content {
        padding: 1rem;
        max-height: none;
        overflow-y: auto;
    }

    .navbar-modern {
        position: sticky;
        top: 0;
        z-index: 1030;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .card-body {
        padding: 1rem;
    }

    .form-control, .form-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }

    .row {
        margin-right: -0.5rem;
        margin-left: -0.5rem;
    }

    .row > [class*='col-'] {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .btn:not(.navbar-toggler) {
    animation: fadeIn 0.3s ease;
}

/* Grid and Utility Classes */
.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

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

.justify-content-between {
    justify-content: space-between;
}

.flex-grow-1 {
    flex-grow: 1;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.ms-1 {
    margin-left: 0.25rem;
}

.me-1 {
    margin-right: 0.25rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.me-3 {
    margin-right: 1rem;
}

.ms-3 {
    margin-left: 1rem;
}

.ms-auto {
    margin-left: auto;
}

.me-auto {
    margin-right: auto;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.w-50 {
    width: 50%;
}

.w-75 {
    width: 75%;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-inline-block {
    display: inline-block;
}

.d-lg-block {
    display: none;
}

.d-lg-flex {
    display: none;
}

.d-lg-none {
    display: block;
}

@media (min-width: 992px) {
    .d-lg-block {
        display: block;
    }

    .d-lg-flex {
        display: flex;
    }

    .d-lg-none {
        display: none;
    }
}

.small {
    font-size: 0.875rem;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.text-start {
    text-align: left;
}

.mt-auto {
    margin-top: auto;
}

.my-auto {
    margin-top: auto;
    margin-bottom: auto;
}

.my-2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.my-3 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mx-2 {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.mx-3 {
    margin-left: 1rem;
    margin-right: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.row > [class*='col-'] {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }

    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

.g-2 {
    gap: 0.5rem;
}

.g-3 {
    gap: 1rem;
}

/* Legend Mobile */
.legend-mobile {
    padding: 1rem 0;
    font-size: 0.875rem;
}

/* Hidden Elements */
.d-hide {
    display: none !important;
}

/* Wallet Options */
.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Admin Form */
.admin-form {
    padding: 0;
}

.admin-form .form-label {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ========== MOBILE MENU TABS ========== */
.mobile-menu-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-top: 2px solid var(--primary-color);
    padding: 0.75rem 0;
    gap: 0.5rem;
    box-shadow: 0 -4px 20px rgba(0, 212, 255, 0.15);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.mobile-menu-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-menu-btn i {
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-btn span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover effect */
.mobile-menu-btn:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.mobile-menu-btn:hover i {
    transform: scale(1.15);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Active state */
.mobile-menu-btn.active {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
}

.mobile-menu-btn.active i {
    transform: scale(1.2);
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.8);
    filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.6));
}

.mobile-menu-btn.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Mobile content hidden class - Apply until 1200px width */
@media (max-width: 1199px) {
    /* Mobile visible/hidden control */
    #premiermenu,
    #deuxiememenu,
    #troisiememenu,
    #quatriememenu {
        width: 100%;
        height: calc(100vh - 120px - 80px);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 1rem 0.5rem 100px 0.5rem;
        display: none;
    }

    #premiermenu.mobile-visible,
    #deuxiememenu.mobile-visible,
    #troisiememenu.mobile-visible,
    #quatriememenu.mobile-visible {
        display: block;
    }
}

/* Adjust main content for mobile menu */
@media (max-width: 1199px) {
    .main-container {
        flex-direction: column;
        padding-bottom: 70px;
    }

    .sidebar-left, .sidebar-right {
        display: none;

    }

    .main-content {
        flex: 1;
        max-height: calc(100vh - 130px);
        padding-bottom: 1.5rem;
    }

    .token-header {
        margin-bottom: 1.5rem;
    }

    /* Mobile Chart - full height */
    #chartaffiche {
        height: calc(100vh - 220px - 8rem) !important;
        min-height: 280px;
        width: 100% !important;
        position: relative !important;
        display: block !important;
    }

    /* Mobile Order Book - Balanced height for SELL and BUY */
    .section-content {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
    }

    .order_section {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        flex: 1 !important;
    }

    #sellorder,
    #buyorder {
        height: calc((50vh - 24px) / 2) !important;
        overflow-y: scroll !important;
        flex: 0 0 auto !important;
        padding: 0.75rem !important;
        margin: 0 !important;
        border-top: none !important;
        padding-top: 0.75rem !important;
        border-radius: 0.375rem !important;
    }

    #sellorder {
        margin-bottom: 0 !important;
        background-color: rgba(239, 68, 68, 0.08) !important;
        flex: 0 0 auto !important;
    }

    #buyorder {
        margin-top: 0 !important;
        background-color: rgba(16, 185, 129, 0.08) !important;
        flex: 1 !important;
        height: auto !important;
    }

    .order-section {
        border-top: none !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Mobile Order Book Container */
    .order-book {
        height: 65vh !important;
        padding: 12px;
        border-radius: 8px;
        background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(37, 45, 61, 0.9) 100%) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .order_section,
    .transaction_section {
        height: auto;
        max-height: 50vh;
    }

    #transactions {
        max-height: 50vh !important;
    }

    /* Hide GemWallet and Crossmark on mobile */
    #gemwallet,
    #crossmarkw {
        display: none !important;
    }

    /* Adjust wallet options grid to 1 column on mobile */
    .wallet-options {
        grid-template-columns: 1fr !important;
    }
}

/**
 * ORIENTATION-BASED MEDIA QUERIES
 * Ensure proper display on tablets in both landscape and portrait modes
 */

/* Tablets and larger devices in PORTRAIT orientation */
@media (orientation: portrait) and (min-width: 768px) {
    html, body {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }

    .main-container {
        flex-direction: column;
        height: 100vh;
        max-height: 100vh;
    }

    .main-content {
        flex: 1;
        overflow-y: auto;
        max-height: calc(100vh - 60px);
        padding: 1rem;
    }

    .sidebar-left, .sidebar-right {
        display: none !important;
    }

    /* Ensure mobile nav is visible in portrait */
    .mobile-nav {
        display: block !important;
    }

    /* Adjust navbar for portrait */
    .navbar-modern {
        position: sticky;
        top: 0;
        z-index: 1030;
        height: auto;
    }
}

/* Tablets and larger devices in LANDSCAPE orientation */
@media (orientation: landscape) and (min-width: 768px) {
    html, body {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }

    /* In landscape, we can show more content */
    .main-container {
        flex-direction: row;
        height: 100vh;
        max-height: 100vh;
    }

    .main-content {
        flex: 1;
        overflow-y: auto;
        max-height: calc(100vh - 60px);
        padding: 1rem;
    }

    /* Show sidebars in landscape if there's enough space */
    .sidebar-left, .sidebar-right {
        display: block;
        overflow-y: auto;
        max-height: calc(100vh - 60px);
    }

    .sidebar-left {
        width: 250px;
        flex-shrink: 0;
        border-right: 1px solid var(--border-color);
    }

    .sidebar-right {
        padding-top:1rem!important;
        width: 300px;
        flex-shrink: 0;
        border-left: 1px solid var(--border-color);
    }

    /* Adjust navbar for landscape */
    .navbar-modern {
        position: sticky;
        top: 0;
        z-index: 1030;
        height: auto;
    }
}

/* Small phones in portrait - priority to content */
@media (orientation: portrait) and (max-width: 767px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }

    .sidebar-left, .sidebar-right {
        display: none !important;
    }

    .main-content {
        padding: 0.75rem;
    }
}

/* Small phones in landscape - maximize space */
@media (orientation: landscape) and (max-width: 767px) {
    html, body {
        height: 100vh;
        overflow: hidden;
    }

    .main-container {
        flex-direction: row;
        height: calc(100vh - 60px);
    }

    .sidebar-left, .sidebar-right {
        display: none !important;
    }

    .sidebar-right{
        padding-top:1rem!important;
    }

    .main-content {
        flex: 1;
        overflow-y: auto;
        padding: 0.5rem;
    }

    .navbar-modern {
        height: 60px;
    }
}