/* style.css */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.5;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dept-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Ensure header content doesn't overlap centered title on smaller screens if possible */
@media (max-width: 768px) {
    .dept-title {
        position: static;
        transform: none;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    header {
        flex-wrap: wrap;
    }
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.user-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Common UI */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: #f1f5f9;
}

.card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 1.5rem;
}

/* Roster Grid */
.roster-grid-container {
    overflow: auto;
    flex: 1;
    border: 1px solid var(--border);
    margin: 0 1.5rem 1.5rem;
    background: white;
}

.roster-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.roster-table th,
.roster-table td {
    border: 1px solid var(--border);
    padding: 0.5rem;
    min-width: 120px;
    height: 40px;
    text-align: center;
}

.roster-table th {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.roster-table .date-col {
    width: 150px;
    background: #f1f5f9;
    position: sticky;
    left: 0;
    z-index: 11;
    text-align: center;
}

.roster-cell {
    cursor: text;
    position: relative;
}

.roster-cell.focused {
    outline: 2px solid var(--primary);
    z-index: 5;
}

.roster-cell.invalid {
    border: 2px solid var(--error);
    background: #fef2f2;
}

.roster-cell.warning {
    border: 2px solid var(--warning);
    background: #fffbeb;
}

.is-weekend {
    background-color: #f8fafc !important;
    /* Subtle difference */
}

.is-weekend td {
    background-color: #f1f5f9;
    /* Slightly darker for weekends */
}

.is-weekend .date-col {
    background-color: #e2e8f0;
    /* Darker for the date column on weekends */
}

.is-weekend .roster-cell:not(.invalid):not(.warning) {
    background-color: #f1f5f9;
}

.is-holiday {
    background-color: #fef2f2 !important;
    /* Slightly reddish tint for holidays */
}

.is-holiday td {
    background-color: #fef2f2;
}

.is-holiday .date-col {
    background-color: #fee2e2;
    border-left: 4px solid var(--error);
}

.is-holiday .roster-cell:not(.invalid):not(.warning) {
    background-color: #fef2f2;
}

.holiday-label {
    font-size: 0.65rem;
    color: var(--error);
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.roster-table th.slot-boundary,
.roster-table td.slot-boundary {
    border-right: 3px solid #64748b;
    /* Thicker, darker border */
}

/* Resolver Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.modal {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 100%;
}

/* Forms */
input,
select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
}

.hidden {
    display: none !important;
}

/* Month Selector */
.month-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.month-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.month-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.month-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.roster-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

main {
    padding-bottom: 2rem;
}

/* Notification Toasts */
#notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: white;
    color: var(--text);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 6px solid var(--primary);
    font-weight: 500;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#notification.success {
    border-left-color: var(--success);
}

#notification.error {
    border-left-color: var(--error);
}

#notification.info {
    border-left-color: var(--primary);
}

#notification.warning {
    border-left-color: var(--warning);
}