/* ========== RESPONSIVE LAYOUT ========== */
:root {
    --sidebar-width: 250px;
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;
}

* {
    box-sizing: border-box;
}

/* Override Bootstrap padding classes that interfere with responsive design */
.responsive-content.px-4 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

.responsive-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    gap: 0;
    margin: 0;
    padding: 0;
}

/* ========== HAMBURGER MENU ========== */
.hamburger-toggle {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1101;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.hamburger-toggle.open {
    transform: rotate(90deg);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-toggle.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-toggle.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-toggle.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========== SIDEBAR ========== */
.sidebar {
    grid-column: 1;
    grid-row: 1 / 3;
    background-color: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.sidebar-backdrop.show {
    display: block;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    grid-column: 2;
    grid-row: 1 / 3;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #fff;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 20px;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.responsive-content {
    padding: 15px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ========== DATABASE STATUS ========== */
.database-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    justify-content: center;
    padding: 8px;
    background-color: #f8d7da;
    transition: all 0.3s ease;
}

.d-none {
    display: none !important;
}

.alert {
    background-color: #f44336;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 14px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.alert-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
    line-height: 1;
    flex-shrink: 0;
}

.close-button:hover {
    opacity: 0.8;
}

/* ========== LOADER ========== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

::deep .k-loader {
    transform: scale(4);
}

::deep .k-loader-container {
    z-index: 10000;
}

::deep .k-loader-info circle {
    stroke: #2196F3 !important;
}

/* ========== SCROLLBAR STYLING ========== */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== RESPONSIVE TAB STYLING ========== */

/* Tablet: Medium tabs */
@media (max-width: 1023px) {
    .custom-tabs .mud-tab {
        min-width: 110px !important;
        padding: 8px 10px !important;
        font-size: 0.85rem;
    }
}

/* Mobile: Smaller tabs with icon-only fallback */
@media (max-width: 767px) {
    .custom-tabs .mud-tabs-toolbar {
        overflow-x: auto;
        scroll-behavior: smooth;
    }

    .custom-tabs .mud-tab {
        min-width: 80px !important;
        padding: 6px 8px !important;
        font-size: 0.75rem;
        transform: skewX(-3deg) !important;
    }

    /* Hide tab text on mobile, show only icons */
    .custom-tabs .mud-tab span {
        display: none;
    }
}

/* Small Mobile: Even more compact, icon-only tabs */
@media (max-width: 479px) {
    .custom-tabs .mud-tabs-toolbar {
        padding: 0 !important;
        gap: 0 !important;
        overflow-x: auto;
        scroll-behavior: smooth;
    }

    .custom-tabs .mud-tab {
        min-width: 50px !important;
        max-width: 60px !important;
        padding: 4px 4px !important;
        border-radius: 4px 4px 0 0 !important;
        transform: skewX(-1deg) !important;
        margin-right: -2px !important;
    }

    .custom-tabs .mud-tab span {
        display: none !important;
    }

    .custom-tabs .mud-icon {
        margin: 0 !important;
    }
}
