/* modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #00BCD4;
    --primary: #00BCD4;
    --primary-gradient: linear-gradient(135deg, #0097A7, #00BCD4, #4DD0E1);
    
    /* Dark Theme Variables (Default) */
    --bg-base: #0a0e17;
    --bg-dark: #0a0e17;
    --bg-surface: rgba(26, 31, 46, 0.65);
    --bg-card: rgba(26, 31, 46, 0.65);
    --bg-glass: rgba(18, 24, 38, 0.85);
    --border-color: rgba(0, 188, 212, 0.15);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f4f8;
    --text-secondary: #a0aec0;
    --text-light: #ffffff;
    --text-muted: #8a99ad;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(20px);
}

[data-theme="light"] {
    /* Light Theme Variables */
    --bg-base: #f0f4f8;
    --bg-dark: #ffffff;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 188, 212, 0.25);
    --border-glass: rgba(0, 188, 212, 0.12);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #1a202c;
    --text-muted: #5e6e82;
    --card-shadow: 0 8px 32px 0 rgba(0, 188, 212, 0.1);
    --glass-blur: blur(20px);
}

/* Light theme text/badge/button visibility corrections */
[data-theme="light"] .text-white,
[data-theme="light"] .text-light {
    color: var(--text-primary) !important;
}

[data-theme="light"] .text-secondary {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .bg-black,
[data-theme="light"] .bg-dark {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] .bg-opacity-50 {
    --bs-bg-opacity: 0.15 !important;
}

[data-theme="light"] .bg-opacity-25 {
    --bs-bg-opacity: 0.1 !important;
}

[data-theme="light"] .bg-opacity-20 {
    --bs-bg-opacity: 0.08 !important;
}

/* Keep white text on solid colored backgrounds */
[data-theme="light"] .btn .text-white,
[data-theme="light"] .btn .text-light,
[data-theme="light"] .badge .text-white,
[data-theme="light"] .badge .text-light,
[data-theme="light"] .alert .text-white,
[data-theme="light"] .alert .text-light,
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-success,
[data-theme="light"] .btn-danger,
[data-theme="light"] .btn-primary-custom,
[data-theme="light"] .badge-success,
[data-theme="light"] .badge-danger,
[data-theme="light"] .badge-primary {
    color: #ffffff !important;
}

[data-theme="light"] .btn-warning,
[data-theme="light"] .btn-info,
[data-theme="light"] .badge-warning,
[data-theme="light"] .badge-info {
    color: #1a202c !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Global Transition overrides for professional theme switching */
body, header, nav, main, footer, 
.glass-card, .glass-panel, .card, .table, td, th, tr, 
input, button, select, textarea, 
.modal-content, .modal-wrapper, 
.sidebar, .top-navbar, .theme-switch, .theme-switch-btn, 
.mobile-tab-bar, .transparent-header, .navbar-brand-premium, .nav-link-custom {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Yan Menü (Slide-in Side Drawer) */
@media (max-width: 992px) {
    .navbar-collapse {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: -280px !important;
        width: 280px !important;
        background: #0d111a !important; /* Fully opaque background in dark theme */
        border-right: 1px solid var(--border-color) !important;
        z-index: 1060 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 85px 24px 24px 24px !important;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5) !important;
    }
    [data-theme="light"] .navbar-collapse {
        background: #ffffff !important; /* Fully opaque background in light theme */
        border-right-color: var(--border-color) !important;
    }
    .navbar-collapse.show {
        left: 0 !important;
    }
    .navbar-collapse .navbar-nav {
        width: 100% !important;
        gap: 10px !important;
    }
    .navbar-collapse .nav-link-custom {
        width: 100% !important;
        display: block !important;
        padding: 12px 16px !important;
    }
    
    /* Stack user details and buttons vertically on mobile drawer */
    .navbar-collapse .d-flex.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        gap: 14px !important;
        margin-top: 20px !important;
        border-top: 1px solid var(--border-color) !important;
        padding-top: 20px !important;
    }
    .navbar-collapse .d-flex.align-items-center .btn {
        width: 100% !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 40px !important;
    }
    .navbar-collapse .d-flex.align-items-center .text-light {
        margin-bottom: 5px !important;
        font-weight: 600 !important;
    }

    
    .mobile-menu-backdrop {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(4, 6, 10, 0.45);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1050;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .mobile-menu-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
}


/* Glassmorphism Container */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Buttons */
.btn-primary-custom {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.4);
    text-decoration: none;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.6);
}

.btn-secondary-custom {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary-custom:hover {
    background: rgba(0, 188, 212, 0.1);
    transform: translateY(-2px);
}

/* Inputs */
.input-custom {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
}
[data-theme="light"] .input-custom {
    background: rgba(0, 0, 0, 0.02);
}
.input-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.2);
}

/* Utilities */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Theme Switcher */
.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s ease;
}
.theme-switch:hover {
    transform: rotate(45deg) scale(1.05);
}

/* Mobile PWA & App Styling defaults (Overwritten on mobile) */
@media (max-width: 768px) {
    .pwa-mobile {
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: 100vh;
    }
}

/* Global Modals */
.modal-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 30px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* Custom Admin/Staff Mobile Responsiveness */
.options-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr auto;
    gap: 12px;
    align-items: flex-end;
}

@media (max-width: 992px) {
    .action-header {
        justify-content: center !important;
        margin-bottom: 15px !important;
    }
    .action-header .btn-primary-custom {
        width: 100% !important;
        border-radius: 12px !important;
        justify-content: center !important;
    }
    .table-container {
        padding: 12px 8px !important;
    }
    .custom-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }
    .custom-table thead {
        display: none !important; /* Hide headings on mobile */
    }
    .custom-table tbody, .custom-table tr {
        display: block !important;
        width: 100% !important;
    }
    .custom-table tr {
        margin-bottom: 16px !important;
        background: var(--bg-surface) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 16px !important;
        padding: 16px !important;
        box-shadow: var(--card-shadow) !important;
    }
    .custom-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
        text-align: right !important;
        font-size: 0.88rem !important;
    }
    [data-theme="light"] .custom-table td {
        border-bottom-color: rgba(0, 0, 0, 0.04) !important;
    }
    .custom-table td:last-child {
        border-bottom: none !important;
    }
    /* Set column name on the left */
    .custom-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left !important;
        margin-right: 15px;
        font-size: 0.82rem;
    }
    .custom-table .table-actions {
        justify-content: flex-end !important;
        width: auto !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    /* Modals & Forms scaling for small viewports */
    .modal-wrapper {
        align-items: flex-start !important;
        overflow-y: auto !important;
        padding: 10px !important;
    }
    .modal-content {
        padding: 20px 16px !important;
        max-width: 100% !important;
        border-radius: 20px !important;
        box-shadow: 0 15px 35px rgba(0,0,0,0.6) !important;
        margin: 20px auto !important;
    }
    .form-grid, .form-grid-single {
        grid-template-columns: 1fr !important; /* Single column forms on mobile */
        gap: 12px !important;
    }
    .modal-header h3 {
        font-size: 1.15rem !important;
    }
    .options-form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .options-form-grid button {
        width: 100% !important;
        margin-top: 5px;
    }
}

/* Premium Iconic Modals and Inputs */
.premium-modal-overlay-glow {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 50px rgba(0, 188, 212, 0.15) !important;
}
.profile-section-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    font-weight: 700;
    margin: 20px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 188, 212, 0.12);
    padding-bottom: 6px;
}
.input-wrapper-iconic {
    position: relative;
    width: 100%;
}
.input-wrapper-iconic .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 188, 212, 0.4);
    font-size: 0.95rem;
    transition: color 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.input-custom-iconic {
    padding-left: 46px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(0, 188, 212, 0.15) !important;
    border-radius: 12px !important;
    font-size: 0.92rem !important;
    height: 48px;
}
[data-theme="light"] .input-custom-iconic {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 188, 212, 0.25) !important;
    color: var(--text-primary) !important;
}
.input-wrapper-iconic:focus-within .input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}
.input-custom-iconic:disabled {
    opacity: 0.55 !important;
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: not-allowed;
}
[data-theme="light"] .input-custom-iconic:disabled {
    background: rgba(0, 0, 0, 0.01) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    color: rgba(0, 0, 0, 0.45) !important;
}
.close-btn-circular {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem !important;
    padding: 0;
    line-height: 1;
}
[data-theme="light"] .close-btn-circular {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
.close-btn-circular:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg);
}