/* ============================================
   Base CSS - CSS Variables, Dark Mode, Basic Styles
   ============================================ */

/* CSS Variables for Light/Dark Theme */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: rgba(0, 0, 0, 0.07);
    --shadow-md: rgba(0, 0, 0, 0.12);
    --shadow-lg: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-card: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #888888;
    --border-color: #404040;
    --shadow-sm: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

html {
    height: 100%;
    /* Set initial background to prevent white flash */
    background-color: #ffffff;
}

html[data-theme="dark"] {
    background-color: #1a1a1a;
}

body {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Set initial background to prevent white flash */
    background-color: #ffffff;
}

[data-theme="dark"] body {
    background-color: #1a1a1a;
}

/* Material Design Badges & Chips */
.badge {
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.badge.bg-primary {
    background-color: #667eea !important;
    color: white !important;
}

[data-theme="dark"] .badge.bg-primary {
    background-color: #5566d8 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

[data-theme="dark"] .badge.bg-secondary {
    background-color: #868e96 !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
    color: white !important;
}

[data-theme="dark"] .badge.bg-success {
    background-color: #20c997 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
    color: white !important;
}

[data-theme="dark"] .badge.bg-info {
    background-color: #1fc8db !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

[data-theme="dark"] .badge.bg-warning {
    background-color: #ffca2c !important;
    color: #212529 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
    color: white !important;
}

[data-theme="dark"] .badge.bg-danger {
    background-color: #e74c3c !important;
}

.badge.bg-light {
    background-color: #495057 !important;
    color: white !important;
}

[data-theme="dark"] .badge.bg-light {
    background-color: #6c757d !important;
    color: white !important;
}

/* Material Design Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-primary {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5566d8;
    border-color: #5566d8;
}

[data-theme="dark"] .btn-primary {
    background-color: #5566d8;
    border-color: #5566d8;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
    border-width: 2px;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    border-width: 2px;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-light {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #212529;
}

.btn-light:hover {
    background-color: #dae0e5;
    border-color: #d3d9df;
    color: #212529;
}

[data-theme="dark"] .btn-light {
    background-color: #495057;
    border-color: #495057;
    color: white;
}

[data-theme="dark"] .btn-light:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Text colors */
.text-muted {
    color: #6c757d !important;
}

[data-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

/* Compact spacing */
.container, .container-fluid {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.card {
    margin-bottom: 1rem !important;
}

.card-body {
    padding: 1rem !important;
}

.card-header {
    padding: 0.75rem 1rem !important;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

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

.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

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

.p-4 {
    padding: 1rem !important;
}

.p-3 {
    padding: 0.75rem !important;
}

/* Card styles */
.card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.card-header {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Backgrounds */
.bg-light {
    background-color: var(--bg-secondary) !important;
}

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

.table thead th {
    border-color: var(--border-color);
}

.table tbody td {
    border-color: var(--border-color);
}

/* Forms */
.form-control {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.form-select {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Modals */
@keyframes modal-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.modal-dialog.pulse {
    animation: modal-pulse 0.3s ease-in-out;
}

.modal-content {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.modal-header {
    border-color: var(--border-color);
}

.modal-footer {
    border-color: var(--border-color);
}

/* Alerts */
.alert-info {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.alert-warning {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* List groups */
.list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.list-group-item:hover {
    background-color: var(--bg-secondary);
}

/* Navbar styles */
.navbar.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .navbar.bg-primary {
    background: linear-gradient(135deg, #1a1d29 0%, #2a2d39 100%) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 1);
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link.active {
    color: rgba(255, 255, 255, 1);
}

[data-theme="dark"] .navbar-dark .navbar-brand {
    color: rgba(255, 255, 255, 0.95);
}

/* Dropdown menu styles */
.dropdown-menu {
    min-width: 240px !important;
    padding: 0.5rem 0;
    background-color: #ffffff;
}

.dropdown-item {
    padding: 0.5rem 1.5rem;
    transition: all 0.15s ease;
    color: #212529;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, #e3f2fd 0%, #f8f9fa 100%);
    color: #0d6efd;
    font-weight: 500;
    transform: translateX(4px);
    border-left: 3px solid #0d6efd;
    padding-left: 1.5rem;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background: linear-gradient(90deg, #2a2d39 0%, #3a3d49 100%);
    color: #667eea;
    font-weight: 500;
    border-left: 3px solid #667eea;
}

[data-theme="dark"] .dropdown-divider {
    border-color: var(--border-color);
}

/* Footer */
footer.bg-dark {
    background-color: #1a1a1a !important;
}

[data-theme="dark"] footer.bg-dark {
    background-color: #0d0d0d !important;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] footer .text-white {
    color: #e0e0e0 !important;
}

[data-theme="dark"] footer .text-white-50 {
    color: rgba(224, 224, 224, 0.6) !important;
}

[data-theme="dark"] footer .border-secondary {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] footer a.text-white-50:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Footer link styles */
footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: #fff !important;
    transform: translateX(3px);
}

.footer-social {
    display: inline-block;
    transition: all 0.3s ease;
}

.footer-social:hover {
    color: #0d6efd !important;
    transform: translateY(-3px);
}

footer h5, footer h6 {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Announcement banner styles */
.announcement-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.95rem;
    border: 3px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    margin-bottom: 2px;
}

.announcement-dismissable {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.announcement-popup_once {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.announcement-permanent {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

[data-theme="dark"] .announcement-banner {
    opacity: 0.95;
}

/* Parent request alert */
.parent-request-alert {
    background-color: #e8e8e8 !important;
    padding: 1rem 0;
    border: none;
}

[data-theme="dark"] .parent-request-alert {
    background-color: #2a2a2a !important;
}

.pending-request-box {
    background-color: #d0d0d0;
}

[data-theme="dark"] .pending-request-box {
    background-color: #3a3a3a;
}

/* Navigation styles */
.navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.navbar-nav .nav-menu-link.active {
    color: #fff !important;
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

@media (max-width: 991.98px) {
    .navbar-nav .nav-item .text-white-50 {
        display: none;
    }
}

/* Dropdown styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    margin-top: 0.5rem;
    background-color: #ffffff;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    color: #212529;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #0d6efd;
    transform: translateX(5px);
}

.dropdown-item.active {
    background: #e7f1ff;
    color: #0d6efd;
    font-weight: 600;
}

[data-theme="dark"] .dropdown-menu {
    background-color: #2b2d31;
    border-color: #404249;
}

[data-theme="dark"] .dropdown-item {
    color: #dbdee1;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #383a40;
    color: #667eea;
}

[data-theme="dark"] .dropdown-item.active {
    background: #404249;
    color: #667eea;
}

/* Pagination styles */
.pagination .page-link {
    color: #0d6efd;
    background-color: #fff;
    border-color: #dee2e6;
}

.pagination .page-link:hover {
    color: #0a58ca;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

[data-theme="dark"] .pagination .page-link {
    color: #6ea8fe;
    background-color: #212529;
    border-color: #495057;
}

[data-theme="dark"] .pagination .page-link:hover {
    color: #9ec5fe;
    background-color: #2b3035;
    border-color: #495057;
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #212529;
    border-color: #495057;
}

/* Responsive */
@media (max-width: 992px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 0.5rem;
    }
}

