/* css/style.css */
:root {
    --dark-blue: #020b18;
    --navy: #0B1B32;
    --gold: #D4AF37;
    --gold-light: #F1D279;
    --white: #ffffff;
    --gray-light: #f4f7f6;
    --danger: #e74c3c;
    --success: #27ae60;
    --sidebar-width: 260px;
    --glass: rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--dark-blue);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--dark-blue);
}
::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

/* Layout SPA */
#app {
    display: flex;
    min-height: 100vh;
}

.mobile-header {
    display: none !important;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--navy);
    border-right: 1px solid var(--glass);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
}

.logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo img {
    height: 32px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.nav-item:hover, .nav-item.active {
    background: var(--glass);
    color: var(--gold);
}

.nav-item i {
    width: 20px;
}

/* Login Page */
.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, var(--navy), var(--dark-blue));
}

.login-card {
    background: var(--navy);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid var(--glass);
    text-align: center;
}

.login-card h2 {
    color: var(--gold);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--glass);
    background: #1a2a40; /* Solid background for compatibility */
    color: white;
    outline: none;
    transition: 0.3s;
}

select option {
    background: #0B1B32; /* Solid navy background */
    color: white;
}

input:focus, select:focus {
    border-color: var(--gold);
    background: #253a56;
}

button {
    color: inherit; /* Allow classes to control colors */
}

.btn {
    padding: 12px 25px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white; /* Default white, but allow overrides */
    background: transparent;
}

.btn-primary {
    background: var(--gold) !important;
    color: var(--dark-blue) !important;
    border-color: var(--gold) !important;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: var(--gold) !important;
}

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

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

/* Action Icons for Tables */
.btn-action {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--gold) !important;
    border-radius: 8px;
}
.btn-action:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}
.btn-action.danger {
    color: #ff4d4d !important;
    border-color: rgba(255, 77, 77, 0.2);
}
.btn-action.danger:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: #ff4d4d;
}

/* Recipient Chips */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    min-height: 40px;
}

.chip {
    background: var(--gold);
    color: var(--navy);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip i {
    cursor: pointer;
    opacity: 0.7;
}

.chip i:hover {
    opacity: 1;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: 0.2s;
}

.close-btn:hover {
    color: var(--gold);
}

.loader {
    text-align: center;
    padding: 50px;
    color: var(--gold);
}

#unread-badge {
    background: var(--danger);
    color: white;
    margin-left: auto;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    background: var(--glass);
    padding: 10px;
    border-radius: 15px;
}

.calendar-day {
    aspect-ratio: 1;
    background: var(--navy);
    padding: 10px;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}

.calendar-day:hover {
    border-color: var(--gold);
    transform: scale(1.02);
}

.calendar-day.inactive {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-day.has-slots::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal {
    background: var(--navy);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    color: var(--gold);
}

.mobile-header {
    display: none !important;
}

/* RESPONSIVE AT THE END */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
        height: 100vh;
        transition: transform 0.3s ease;
    }
    .sidebar.active {
        transform: translateX(0);
        display: flex !important;
    }
    .sidebar .logo {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
        margin-top: 60px;
    }
    .calendar-grid {
        gap: 5px;
        grid-template-columns: repeat(4, 1fr);
    }
    .calendar-day {
        min-height: 80px;
        height: auto;
        padding: 5px;
    }
    .mobile-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: var(--navy);
        z-index: 1100;
        align-items: center;
        padding: 0 15px; /* Reduced for more space */
        border-bottom: 1px solid var(--glass);
        justify-content: space-between;
    }
    
    .header, .calendar-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    .header h2, .calendar-header h2 {
        white-space: nowrap;
        font-size: 18px; /* Slightly smaller for better fit */
        margin-bottom: 5px;
        width: auto !important;
    }
    
    .header-actions, .calendar-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap;
        gap: 10px !important;
    }

    .slot-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 20px !important; /* Larger padding for mobile touch */
    }

    .slot-info {
        width: 100%;
        display: block !important;
    }

    .slot-actions {
        width: 100%;
        justify-content: flex-start !important;
        gap: 8px !important;
    }
    
    .badge {
        white-space: nowrap !important;
        display: inline-block !important;
        margin-top: 5px;
    }
}
