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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.user-section {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.username-input {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.username-input input {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 250px;
    transition: all 0.3s ease;
}

.username-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.username-input button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.username-input button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.username-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.timezone-section {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.timezone-selector-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.timezone-selector-wrapper label {
    font-weight: 500;
    color: #333;
}

.timezone-selector-wrapper select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 300px;
    max-width: 400px;
}

.timezone-selector-wrapper select optgroup {
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
}

.timezone-selector-wrapper select option {
    padding: 4px 8px;
    font-size: 13px;
}

.timezone-display {
    text-align: center;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.instructions {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.instructions small {
    display: block;
    margin-top: 5px;
    color: #999;
}

.content-wrapper {
    display: flex;
    min-height: 600px;
}

.calendar-section {
    flex: 1;
    padding: 20px;
    background: white;
}

.week-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.day-header {
    padding: 15px;
    background: #667eea;
    color: white;
    text-align: center;
    font-weight: bold;
    border-radius: 5px;
    font-size: 14px;
}

.time-label {
    background: transparent;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
    max-height: 500px;
    overflow-y: auto;
}

.time-slot-label {
    padding: 8px 5px;
    background: #f8f9fa;
    border-right: 2px solid #e9ecef;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.time-slot {
    min-height: 25px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.time-slot:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.time-slot.selected {
    background: #4caf50;
    border-color: #45a049;
}

.time-slot.heatmap-1 {
    background: #e8f5e8;
    border-color: #c8e6c9;
}

.time-slot.heatmap-2 {
    background: #c8e6c9;
    border-color: #a5d6a7;
}

.time-slot.heatmap-3 {
    background: #a5d6a7;
    border-color: #81c784;
}

.time-slot.heatmap-4 {
    background: #81c784;
    border-color: #66bb6a;
}

.time-slot.heatmap-5 {
    background: #66bb6a;
    border-color: #4caf50;
}

.time-slot.heatmap-6 {
    background: #4caf50;
    border-color: #43a047;
}

.time-slot.heatmap-7 {
    background: #2e7d32;
    border-color: #1b5e20;
    color: white;
}

.time-slot.selecting {
    background: #81c784;
    border-color: #66bb6a;
}

/* Visual feedback for drag selection */
.time-slot.drag-invalid {
    background: #ffcdd2;
    border-color: #f44336;
    cursor: not-allowed !important;
}

.sidebar {
    width: 350px;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    padding: 20px;
    overflow-y: auto;
}

.sidebar h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.heatmap-section {
    margin-bottom: 30px;
}

.heatmap-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.participants-section {
    margin-bottom: 30px;
}

.participants-list {
    max-height: 200px;
    overflow-y: auto;
}

.participant-item {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.participant-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.participant-slots {
    font-size: 12px;
    color: #666;
}

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

.stats-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.stat-label {
    font-size: 14px;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #333;
}

/* Scrollbar styling */
.calendar-grid::-webkit-scrollbar,
.participants-list::-webkit-scrollbar {
    width: 8px;
}

.calendar-grid::-webkit-scrollbar-track,
.participants-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.calendar-grid::-webkit-scrollbar-thumb,
.participants-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.calendar-grid::-webkit-scrollbar-thumb:hover,
.participants-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    
    .calendar-grid {
        font-size: 12px;
    }
    
    .time-slot {
        min-height: 20px;
    }
}

@media (max-width: 768px) {
    .username-input {
        flex-direction: column;
    }
    
    .username-input input {
        width: 100%;
    }
    
    .timezone-selector-wrapper {
        flex-direction: column;
        gap: 5px;
    }
    
    .timezone-selector-wrapper select {
        min-width: auto;
        max-width: 100%;
        width: 100%;
        font-size: 13px;
    }
    
    .week-header {
        font-size: 12px;
    }
    
    .day-header {
        padding: 10px 5px;
    }
}