/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1rem;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

/* Form elements */
input, textarea, select, button, .btn, .form-control, .form-select, .form-check-input {
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ==================== MENUBAR STYLES ==================== */
.menubar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark-mode .menubar {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.menubar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

.menubar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.menubar-brand:hover {
    color: rgba(255, 255, 255, 0.9);
}

.menubar-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menubar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.menubar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.menubar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.menubar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Consistent style for all menubar-right items */
.user-info,
.btn-theme,
.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.user-info:hover,
.btn-theme:hover,
.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Font size controls */
.font-size-controls {
    display: flex;
    gap: 2px;
}

.btn-font {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-font:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-font:last-child {
    border-radius: 0 6px 6px 0;
}

.btn-font:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== STANDALONE THEME TOGGLE ==================== */

/* Standalone theme toggle (for home/login pages) */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

body.dark-mode .theme-toggle {
    background: rgba(45, 55, 72, 0.9);
    color: #e0e0e0;
}

/* ==================== CARDS ==================== */
.card {
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: none;
}

body.dark-mode .card {
    background: #2d3748;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 20px;
}

.card-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.card-header .btn-light {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
}

.card-header .btn-light:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

body.dark-mode .card-body {
    color: #e0e0e0;
}

/* ==================== FORMS ==================== */
.form-control {
    border-radius: 8px;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #1a202c;
    border-color: #4a5568;
    color: #e0e0e0;
}

body.dark-mode .form-select option {
    background: #1a202c;
    color: #e0e0e0;
}

body.dark-mode .form-label {
    color: #e0e0e0;
}

/* ==================== TABLES ==================== */
body.dark-mode .table {
    color: #e0e0e0;
    --bs-table-bg: transparent;
    --bs-table-color: #e0e0e0;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
    --bs-table-hover-color: #e0e0e0;
}

body.dark-mode .table thead th {
    background: #1a202c;
    color: #e0e0e0;
    border-color: #4a5568;
}

body.dark-mode .table tbody tr {
    background: #2d3748;
    color: #e0e0e0;
}

body.dark-mode .table tbody tr:nth-of-type(odd) {
    background: #343f52;
}

body.dark-mode .table tbody tr:hover {
    background: rgba(102, 126, 234, 0.2);
}

body.dark-mode .table tbody td {
    border-color: #4a5568;
    color: #e0e0e0;
}

body.dark-mode .table .text-muted {
    color: #a0aec0 !important;
}

/* ==================== MODALS ==================== */
body.dark-mode .modal-content {
    background: #2d3748;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    border-color: #4a5568;
}

body.dark-mode .modal-footer {
    border-color: #4a5568;
}

body.dark-mode .modal-body .text-muted {
    color: #a0aec0 !important;
}

body.dark-mode .btn-close {
    filter: invert(1);
}

/* ==================== ALERTS ==================== */
.alert {
    border-radius: 10px;
}

/* ==================== BADGES ==================== */
.badge-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ==================== BUTTONS ==================== */
.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-add:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    color: white;
}

/* ==================== MOBILE MENU TOGGLE ==================== */
.menubar-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menubar-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.menubar-toggle.active {
    background: rgba(255, 255, 255, 0.3);
}

.menubar-collapse {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: space-between;
    margin-left: 20px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .menubar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .menubar .container-fluid {
        flex-wrap: wrap;
        position: relative;
    }

    .menubar-collapse {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 10px;
        margin-left: 0;
    }

    .menubar-collapse.show {
        display: flex;
    }

    .menubar-nav {
        flex-direction: column;
        width: 100%;
    }

    .menubar-nav .nav-link {
        padding: 12px 16px;
        border-radius: 8px;
        justify-content: center;
    }

    .menubar-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .user-info,
    .btn-theme,
    .btn-logout {
        padding: 10px 16px;
    }
}

@media (max-width: 576px) {
    .menubar .container-fluid {
        padding: 10px 15px;
    }

    .menubar-brand {
        font-size: 1rem;
    }

    .menubar-brand .brand-text {
        display: none;
    }

    .user-info span {
        display: none;
    }

    /* Larger touch targets for mobile */
    .menubar-nav .nav-link {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .btn-theme,
    .btn-logout {
        padding: 12px 16px;
        font-size: 1rem;
    }

    /* Theme toggle standalone */
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
    }

    /* Modal centered on mobile */
    .modal {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .modal-dialog {
        max-width: 95% !important;
        margin: 0 auto;
    }

    .modal-dialog .modal-content {
        border-radius: 12px;
    }
}
