/* styles.css - Chrooms Stylesheet */

/* CSS Variables */
:root {
    --chalmers-blue: #1e3a52;
    --chalmers-dark: #152b3f;
    --chalmers-light: #2c5f7c;
    --action-orange: #ff5722;
    --action-orange-hover: #e64a19;
    --success-green: #4caf50;
    --warning-orange: #ff9800;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: #e0e0e0;
    --background-light: #f5f5f5;
    --background-lighter: #f8f8f8;
    --hover-blue: #e3f2fd;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-light);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--chalmers-blue);
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Demo Header */
.demo-header {
    background: var(--chalmers-blue);
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-right: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Demo header specific logo */
.demo-header .logo {
    margin-right: 0;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 20px;
    opacity: 0.9;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    flex: 1;
    gap: 0;
    justify-content: center;
}

/* Demo header navigation */
.demo-header .nav-tabs {
    flex: 1;
    justify-content: center;
    margin: 0 20px;
}

.nav-tab {
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

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

.nav-tab.active {
    border-bottom-color: var(--action-orange);
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Demo header controls */
.demo-header .header-controls {
    flex-shrink: 0;
}

.language-toggle {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.lang-btn {
    padding: 6px 12px;
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    color: var(--chalmers-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.chalmers-logo {
    width: 40px;
    height: 40px;
}

.chalmers-logo img {
    width: 100%;
    height: 100%;
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 60px);
    background: white;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--background-lighter);
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: 24px;
}

.section-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header .arrow {
    display: inline-block;
    transition: transform 0.3s;
}

.section-header.expanded .arrow {
    transform: rotate(90deg);
}

.section-content {
    animation: slideDown 0.3s ease;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.filter-hint {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* Campus Tabs */
.campus-tabs {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.campus-tab {
    flex: 1;
    padding: 8px 16px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.campus-tab:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.campus-tab:hover {
    background: var(--hover-blue);
}

.campus-tab.active {
    background: var(--chalmers-blue);
    color: white;
}

/* Chips */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.chip {
    padding: 6px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.chip:hover {
    border-color: var(--chalmers-blue);
    background: var(--hover-blue);
}

.chip.active {
    background: var(--chalmers-blue);
    color: white;
    border-color: var(--chalmers-blue);
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    max-width: calc(100vw - 550px);
    /* Ensure it doesn't exceed available space */
    /* Allow flex item to shrink below content size */
}

/* Campus Header */
.campus-header {
    background: linear-gradient(135deg, var(--chalmers-light) 0%, #4a8fb9 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-light);
}

.campus-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: -0.5px;
}

/* Week Navigation */
.week-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.week-btn {
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: var(--shadow-light);
}

.week-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-medium);
}

.week-display {
    background: rgba(255, 255, 255, 0.95);
    color: var(--chalmers-blue);
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: 500;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.view-btn.active {
    background: white;
    color: var(--chalmers-blue);
    border-color: white;
}

/* Schedule Container */
.schedule-container {
    flex: 1;
    overflow: auto;
    background: white;
    min-width: 0;
    /* Allow container to shrink */
}

/* Schedule Table */
.schedule-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.schedule-table th {
    background: var(--chalmers-blue);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
}

.schedule-table th:not(.room-column):not(.info-column) {
    min-width: 120px;
    width: 120px;
}

.schedule-table td {
    padding: 8px;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.schedule-table td:not(.room-column):not(.info-column) {
    min-width: 120px;
    width: 120px;
}

.room-column {
    width: 120px;
}

.info-column {
    width: 100px;
}

/* Time Slots Row */
.time-slots-row {
    background: var(--chalmers-light);
}

.time-slot-header {
    background: var(--chalmers-light);
    color: white;
    padding: 4px 2px;
    text-align: center;
    font-size: 10px;
    font-weight: 400;
    border: 1px solid var(--chalmers-dark);
    position: sticky;
    top: 40px;
    z-index: 9;
    min-width: 120px;
    width: 120px;
}

.hour-slots {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.hour {
    flex: 1;
    text-align: center;
    font-size: 8px;
    font-weight: 500;
    padding: 1px 0px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 0;
}

.hour:last-child {
    border-right: none;
}

/* Building Rows */
.building-row {
    background: var(--background-lighter);
}

.building-toggle {
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    width: 100%;
    text-align: left;
    transition: background 0.3s;
}

.building-toggle:hover {
    background: var(--hover-blue);
}

/* Room Rows */
.room-row td {
    background: white;
}

.room-name {
    padding-left: 24px !important;
    font-weight: 500;
}

/* Time Slots */
.time-slot {
    min-height: 40px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot.available:hover {
    background: var(--hover-blue);
    box-shadow: inset 0 0 0 2px var(--chalmers-blue);
}

.time-slot.booked {
    background: var(--chalmers-blue);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    cursor: not-allowed;
}

.time-slot.past {
    background: var(--background-light);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Right Sidebar */
.right-sidebar {
    width: 250px;
    background: white;
    border-left: 1px solid var(--border-color);
    padding: 15px;
    overflow-y: auto;
    flex-shrink: 0;
}

.booking-summary-section h3,
.previous-searches h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Booking Card */
.booking-card {
    background: var(--background-lighter);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-light);
    animation: slideIn 0.3s ease;
}

.booking-time {
    font-size: 20px;
    font-weight: 600;
    color: var(--chalmers-blue);
    margin-bottom: 8px;
}

.booking-details {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Map Preview */
.map-preview {
    height: 150px;
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    border-radius: 4px;
    margin-top: 12px;
    position: relative;
    overflow: hidden;
}

.map-preview::after {
    content: '📍 Map Preview';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-size: 14px;
}

/* Previous Searches */
.previous-searches {
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
    padding-top: 24px;
}

.search-item {
    background: var(--background-lighter);
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-item:hover {
    background: var(--hover-blue);
    transform: translateX(4px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-heavy);
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.booking-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.info-row strong {
    min-width: 100px;
}

.time-highlight {
    color: var(--chalmers-blue);
    font-weight: bold;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

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

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 12px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .right-sidebar {
        width: 220px;
    }

    .content {
        max-width: calc(100vw - 520px);
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }

    .chip {
        font-size: 11px;
        padding: 5px 12px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}