:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --accent: #f59e0b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== UTILITY: MUST be defined for show/hide to work ===== */
.hidden {
    display: none !important;
}

body.role-user .admin-only {
    display: none !important;
}

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

body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    padding: 0.5rem;
    border-radius: 12px;
    line-height: 1;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile-nav:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-profile-nav img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile-nav span {
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.admin-only {
    display: none !important;
}

.role-admin .admin-only {
    display: inline-flex !important;
}

.role-admin .nav-link.admin-only {
    display: block !important;
}

.content-area {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
    flex: 1;
}

.view {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none;
}

.view-header {
    margin-bottom: 2.5rem;
}

.view-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.view-header p {
    color: var(--text-dim);
}

.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card i {
    width: 50px;
    height: 50px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-card.occupied i {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
}

.stat-card.total i {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-info .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Rooms Grid */
.rooms-grid, .realtime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.room-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.room-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
}

.room-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.room-card:hover::after {
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}


.room-image-container {
    height: 180px;
    position: relative;
}

.room-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.status-available { 
    background: rgba(16, 185, 129, 0.85); 
    color: white; 
    animation: glow-green 2s infinite;
}

.status-occupied { 
    background: rgba(239, 68, 68, 0.85); 
    color: white; 
    animation: glow-red 2s infinite;
}

@keyframes glow-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes glow-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 8px white;
}

.room-content {
    padding: 1.5rem;
}

.room-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.room-details {
    display: flex;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.room-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.room-actions {
    display: flex;
    gap: 0.75rem;
}

/* Real-time status card inside each room */
.room-status-card {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
}

.occupied-card {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.available-card {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.status-label-text {
    font-size: 0.85rem;
}

.status-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.detail-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}


/* Active booking info on dashboard */
.current-booking-info {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.current-booking-info p { margin: 0.2rem 0; }
.meeting-title { font-weight: 700; }

/* Upcoming bookings section */
.upcoming-bookings {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.upcoming-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.upcoming-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    flex-wrap: wrap;
    color: var(--text-dim);
}

.upcoming-item:last-child { border-bottom: none; }
.upcoming-date { font-weight: 600; color: white; min-width: 90px; }
.upcoming-title {
    flex: 1;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1);
}


.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.w-full { width: 100%; }

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

.modal.active { display: flex; }

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content {
    background: var(--surface);
    width: 95%;
    max-width: 500px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    animation: modalSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
}
/* Booking List Items (Global & Personal) */
.all-bookings-grid, .bookings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.booking-group-header {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.booking-group-header::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.booking-list-item {
    display: flex;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    transition: transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.booking-list-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.booking-time-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.booking-time-info.is-active-now {
    background: rgba(16, 185, 129, 0.15);
}

.booking-time-info.is-past {
    opacity: 0.5;
}

.b-date {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.b-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.booking-main-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.booking-main-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.booking-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.booking-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.booking-actions {
    padding: 1.5rem;
    display: flex;
    align-items: center;
}

.live-label {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

.status-label {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.status-label.success {
    color: var(--success);
}

.status-label.done {
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
}

.is-past-item {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.btn-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: var(--danger);
    color: white;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.is-active-now {
    border: 1px solid var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Reports Tab */
.report-container {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.report-filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.report-table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

/* Profile View */
.profile-card {
    max-width: 600px;
    margin: 0 auto;
    padding: 2.5rem;
    border-radius: var(--radius);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.profile-avatar-large {
    position: relative;
    width: 110px;
    height: 110px;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.btn-edit-avatar {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

.profile-main-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.profile-main-info p {
    color: var(--text-dim);
}

/* Responsive */

/* Login View */
.login-view {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    z-index: 3000;
}

.logo-large {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    overflow: hidden; /* Prevent overflow */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border: 2px solid var(--primary);
}

.logo-large img {
    width: 80% !important;
    height: 80% !important;
    object-fit: contain;
    border-radius: 0;
}

.login-card {
    width: 90%;
    max-width: 400px;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 24px;
    animation: loginIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes loginIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}


.login-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.login-hints {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    text-align: left;
}

.login-hints p {
    margin-bottom: 0.5rem;
}

/* Login Tabs */
.login-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255,255,255,0.04);
    padding: 0.35rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.login-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.login-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.login-panel {
    text-align: left;
}

/* Teacher dropdown */
.teacher-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.dropdown-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.dropdown-item p {
    margin: 0;
    font-size: 0.85rem;
}

/* Selected teacher card */
.selected-teacher {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.selected-teacher img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.selected-teacher p {
    margin: 0;
    font-weight: 600;
}


/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
    from { transform: translateX(100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast.toast-out {
    animation: toastOut 0.5s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastOut {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(100%) scale(0.9); opacity: 0; }
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.toast-success .toast-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.toast-info .toast-icon { background: rgba(99, 102, 241, 0.1); color: var(--primary); }

.toast-content h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.1rem; }
.toast-content p { font-size: 0.8rem; color: var(--text-dim); }

/* Booking Modal Extensions */
.booking-extra-sections {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.extra-tabs-content {
    min-height: 250px;
}

.extra-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.extra-section h4 {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 0.5rem; }

.form-group-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 1.2rem;
    height: 1.2rem;
}

.text-dim {
    color: var(--text-dim);
}

.extra-requirements-toggle {
    margin: 1rem 0;
}

#toggleExtraBtn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-dim);
    transition: all 0.2s;
}

#toggleExtraBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

#toggleExtraBtn.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

#extraIcon {
    transition: transform 0.3s;
}

/* Tabs System */
.extra-tabs-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.5rem 2rem 1rem 2rem; /* Added 2rem padding for bounce space */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 -2rem 1.5rem -2rem; /* Pull back with negative margin to keep edge-to-edge look if desired */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.extra-tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: slideUpFade 0.4s ease-out;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Grids */
.grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }

/* Modal Fix for Mobile & Scrolling */
.modal-content {
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    width: 95%;
    max-width: 600px;
}

.modal-content form {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 15px; /* Space for scrollbar */
    scroll-behavior: smooth;
    max-height: 70vh;
}

/* HIGH VISIBILITY SCROLLBAR */
.modal-content form::-webkit-scrollbar {
    width: 10px;
}

.modal-content form::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.modal-content form::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.modal-content form::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* PRINT STYLES */
@media print {
    body * { visibility: hidden; }
    #printTemplate, #printTemplate * { visibility: visible; }
    #printTemplate {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white !important;
        color: black !important;
    }
    .print-container {
        padding: 20px;
        font-family: "TH SarabunPSK", "Sarabun", sans-serif;
    }
    .print-header {
        text-align: center;
        border-bottom: 2px solid black;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    .print-header h2 { margin: 10px 0 5px 0; color: black; }
    .print-section { margin-bottom: 20px; }
    .print-section h3 { border-left: 5px solid black; padding-left: 10px; margin-bottom: 10px; color: black; }
    .print-table {
        width: 100%;
        border-collapse: collapse;
    }
    .print-table th, .print-table td {
        text-align: left;
        padding: 8px;
        border: 1px solid #ddd;
        color: black;
    }
    .print-table th { width: 30%; background: #f9f9f9 !important; }
    .print-footer {
        display: flex;
        justify-content: space-between;
        margin-top: 60px;
        text-align: center;
        gap: 10px;
    }
    .sig-block { width: 32%; }
    .sig-block p { margin: 8px 0; color: black; font-size: 0.9rem; }
}
.radio-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chip {
    cursor: pointer;
}

.chip input {
    display: none;
}

.chip span {
    display: block;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-dim);
    transition: all 0.2s;
    text-align: center;
}

.chip input:checked + span {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
    box-shadow: 0 0 0 1px var(--primary);
}

/* Booking Details Modal Styling */
.booking-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
}

.detail-item.full { grid-column: span 2; }
.detail-item .label { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.2rem; }
.detail-item .value { font-weight: 600; font-size: 0.95rem; color: white; }

.detail-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
}

.detail-card h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    padding-bottom: 0.5rem;
}

.detail-card ul { padding-left: 1.5rem; margin-top: 0.5rem; }
.detail-card li { margin-bottom: 0.3rem; font-size: 0.85rem; }
.detail-card p { font-size: 0.85rem; line-height: 1.5; }
.detail-card.empty { text-align: center; color: var(--text-dim); padding: 2rem; }

/* Modal Body Scrollbar */
#bookingDetailContent {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#bookingDetailContent::-webkit-scrollbar {
    width: 6px;
}

#bookingDetailContent::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#bookingDetailContent::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}
