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

:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    
    /* Slot colors */
    --free-slot: #ffffff;
    --free-border: #e2e8f0;
    --free-text: #10b981;
    --free-hover: #f8fafc;
    
    --busy-slot: #fef2f2;
    --busy-border: #fecaca;
    --busy-title: #b91c1c;

    --radius-lg: 16px;
    --radius-md: 12px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    background-image: 
        radial-gradient(at 0% 0%, hsla(220, 100%, 94%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(210, 100%, 93%, 1) 0px, transparent 50%);
    background-attachment: fixed;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    z-index: 1;
}

/* Header */
.app-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 32px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    box-shadow: var(--shadow-md);
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px; /* Tight gap as per request text stack */
}

.subtitle-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
}

.brand-logo-img {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-img img {
    height: 42px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

/* header titles styling inline in html now */

/* Date Selector */
.date-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.date-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
}

.day-literal {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 700;
}

.actual-date {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    background: #f8fafc;
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.ml-2 { margin-left: 8px; }

/* Main Schedule Layout */
.schedule-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.timetable-header {
    display: flex;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-col {
    width: 120px;
    flex-shrink: 0;
}

.status-col {
    flex-grow: 1;
}

.slots-list {
    display: flex;
    flex-direction: column;
}

.slot-item {
    display: flex;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    align-items: center;
}

.slot-item:last-child {
    border-bottom: none;
}

.slot-item:nth-child(even) {
    background-color: #fafbfc;
}

.time-badge-label {
    width: 120px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-badge-label i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.slot-content {
    flex-grow: 1;
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Slot States */
.slot-free {
    background: var(--free-slot);
    border-color: var(--free-border);
    box-shadow: var(--shadow-sm);
}

.slot-free:hover {
    background: var(--free-hover);
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.free-text {
    color: var(--free-text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-prompt {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s;
    background: #eff6ff;
    padding: 6px 12px;
    border-radius: 20px;
}

.slot-free:hover .book-prompt {
    opacity: 1;
    transform: translateX(0);
}

.slot-busy {
    background: var(--busy-slot);
    border-color: var(--busy-border);
    box-shadow: var(--shadow-sm);
}

.slot-busy:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.busy-info {
    display: flex;
    flex-direction: column;
}

.busy-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
}

.busy-user {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 32px;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #f1f5f9;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.time-badge {
    background: #eff6ff;
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.busy {
    background: #fee2e2;
    color: var(--busy-title);
    border: 1px solid #fecaca;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) inset;
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-cancel {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 15px;
}

.btn-cancel:hover {
    background: #f8fafc;
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-confirm {
    flex: 2;
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-confirm:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.details-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    font-weight: 500;
}

.detail-row i {
    color: var(--text-secondary);
    width: 20px;
}

.highlight-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

#deleteBookingBtn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--danger);
    border-color: #fca5a5;
    background: #fef2f2;
}

#deleteBookingBtn:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
}
.mt-4 { margin-top: 24px; }

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0;
    color: var(--text-secondary);
    gap: 16px;
    font-weight: 500;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Mobile adjustments */
@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        align-items: flex-start;
    }
    .date-selector {
        width: 100%;
        justify-content: space-between;
    }
    .slot-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .timetable-header {
        display: none;
    }
    .slot-content {
        width: 100%;
    }
}
