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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.app-container {
    display: flex;
    gap: 20px;
    max-width: 1800px;
    margin: 0 auto;
    height: calc(100vh - 40px);
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    background: #ff6600;
    color: white;
}

.sidebar-header h2 {
    font-size: 1.5em;
    margin: 0;
}

.teacher-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.teacher-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    border-bottom: 1px solid #f0f0f0;
}

.teacher-item:hover {
    background: #fff5e6;
    border-left-color: #ff6600;
}

.teacher-item.active {
    background: #fff0e0;
    border-left-color: #ff6600;
    font-weight: 600;
    color: #ff6600;
}

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

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
}

.container {
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    height: fit-content;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    color: #ff6600;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.sync-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.sync-status.synced {
    color: #28a745;
}

.sync-status.syncing {
    color: #ff6600;
}

.sync-status.local-only {
    color: #999;
}

#syncIcon {
    display: inline-block;
    animation: none;
}

#syncIcon.syncing {
    animation: spin 1s linear infinite;
}

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

.calendar-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #ff6600;
    color: white;
}

.btn-primary:hover {
    background: #e55a00;
}

.btn-secondary {
    background: #1a1a1a;
    color: white;
}

.btn-secondary:hover {
    background: #333333;
}

.btn-success {
    background: #ff6600;
    color: white;
}

.btn-success:hover {
    background: #e55a00;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr);
    gap: 2px;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2px;
}

.time-header {
    background: #ff6600;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
}

.day-header {
    background: #ff6600;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1em;
}

.time-slots-container {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr);
    gap: 2px;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.time-label {
    background: #f8f9fa;
    padding: 10px 7px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    color: #495057;
    border-right: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot {
    background: white;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
    min-height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    background: #fff5e6;
    border-color: #ff6600;
}

/* Slot states */
.time-slot.state-available {
    background: #6b8e23; /* Olive green */
    color: white;
    border-color: #556b2f;
    box-shadow: 0 2px 8px rgba(107, 142, 35, 0.4);
}

.time-slot.state-unavailable {
    background: #8b0000; /* Dark red */
    color: white;
    border-color: #6b0000;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.4);
}

.time-slot.state-navy {
    background: #000080; /* Navy blue */
    color: white;
    border-color: #000060;
    box-shadow: 0 2px 8px rgba(0, 0, 128, 0.4);
}

.time-slot.state-cyan {
    background: #00bcd4; /* Cyan */
    color: white;
    border-color: #0097a7;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.4);
}

.time-slot.state-magenta {
    background: #ff00ff; /* Magenta */
    color: white;
    border-color: #cc00cc;
    box-shadow: 0 2px 8px rgba(255, 0, 255, 0.4);
}

.time-slot.state-salmon {
    background: #fa8072; /* Salmon */
    color: white;
    border-color: #e87162;
    box-shadow: 0 2px 8px rgba(250, 128, 114, 0.4);
}

.summary-panel {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.summary-panel h2 {
    color: #ff6600;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.summary-content {
    max-height: 300px;
    overflow-y: auto;
}

.day-summary {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #ff6600;
}

.day-summary h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.day-summary .hours {
    color: #666;
    line-height: 1.8;
}

.empty-message {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* Context Menu */
.context-menu {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    z-index: 1000;
    min-width: 180px;
}

.context-menu.show {
    display: block;
}

.context-menu-title {
    padding: 8px 16px;
    font-weight: 600;
    color: #ff6600;
    font-size: 0.9em;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.context-menu-item:hover {
    background: #f0f0f0;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.context-menu-separator {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

@media (max-width: 1200px) {
    .calendar-grid,
    .time-slots-container {
        grid-template-columns: 80px repeat(7, 1fr);
    }
    
    .time-header,
    .time-label {
        font-size: 0.8em;
        padding: 7px 3px;
    }
    
    .day-header {
        font-size: 0.9em;
        padding: 7px 3px;
    }
    
    .time-slot {
        padding: 7px;
        min-height: 26px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .teacher-list {
        display: flex;
        overflow-x: auto;
        flex-wrap: wrap;
    }
    
    .teacher-item {
        min-width: 120px;
        border-bottom: 1px solid #f0f0f0;
        border-left: none;
        border-top: 4px solid transparent;
    }
    
    .teacher-item:hover,
    .teacher-item.active {
        border-left: none;
        border-top-color: #ff6600;
    }
    
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .calendar-grid,
    .time-slots-container {
        grid-template-columns: 60px repeat(7, 1fr);
    }
    
    .time-label,
    .day-header {
        font-size: 0.7em;
        padding: 5px 2px;
    }
    
    .time-slot {
        padding: 5px;
        min-height: 23px;
    }
    
    .time-slot.selected::after {
        font-size: 1em;
    }
}

