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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 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 */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 15px;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 600px;
}

/* Sidebar */
.sidebar {
    background: #f8fafc;
    padding: 30px;
    border-right: 1px solid #e2e8f0;
}

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

.selection-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d3748;
}

.custom-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

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

.custom-select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Selected Slots */
.selected-slots {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
}

.selection-summary {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.summary-row:last-child {
    margin-bottom: 0;
    padding-top: 4px;
    border-top: 1px solid #bae6fd;
}

.no-selection {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    margin-top: 40px;
}

.selected-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.selected-slot:last-child {
    margin-bottom: 0;
}

.slot-price-display {
    color: #059669;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.remove-slot {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.remove-slot:hover {
    background: #dc2626;
}

/* Student Form */
.student-form {
    margin-top: 20px;
}

.student-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

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

.submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Calendar Container */
.calendar-container {
    padding: 30px;
    overflow-x: auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.calendar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.instructions {
    flex: 1;
    text-align: center;
}

.instructions p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.legend-item::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
}

.legend-item.available::before {
    background: #10b981;
}

.legend-item.selected::before {
    background: #3b82f6;
}

.legend-item.unavailable::before {
    background: #ef4444;
}

/* Weekly Calendar */
.weekly-calendar {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    min-width: 800px;
}

.time-header {
    background: #4a5568;
    color: white;
    padding: 12px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.day-header {
    background: #2d3748;
    color: white;
    padding: 16px;
    text-align: center;
    font-weight: 600;
}

.time-slot {
    background: white;
    padding: 8px;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 500;
    color: #4a5568;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-slot {
    background: #f8fafc;
    border: 1px solid transparent;
    cursor: not-allowed;
    transition: all 0.2s ease;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4px;
}

.calendar-slot.available {
    background: #ecfdf5;
    border-color: #10b981;
    cursor: pointer;
    user-select: none;
}

.calendar-slot.available:hover {
    background: #d1fae5;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.calendar-slot.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    cursor: pointer;
}

.calendar-slot.selecting {
    background: #fef3c7;
    border-color: #f59e0b;
    transform: scale(1.02);
}

.calendar-slot.selection-preview {
    background: #fef3c7;
    border-color: #f59e0b;
    opacity: 0.8;
}

.calendar-slot.unavailable {
    background: #fef2f2;
    border-color: #ef4444;
}

.slot-price-info {
    font-size: 0.65rem;
    font-weight: 700;
    color: #059669;
    text-align: center;
    background: rgba(16, 185, 129, 0.15);
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1.2;
}

.slot-details {
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
}

.calendar-slot.slot-start {
    min-height: 80px;
    border-width: 2px;
}

.calendar-slot.slot-continuation {
    border-top: none;
    min-height: 20px;
    background: inherit;
    opacity: 0.7;
}

.slot-info {
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.2;
}

.slot-time {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.slot-duration {
    color: #6b7280;
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.slot-price {
    color: #059669;
    font-weight: 700;
    font-size: 0.8rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.empty-calendar-message {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 300px 1fr;
        gap: 20px;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .calendar-container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .sidebar {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .weekly-calendar {
        min-width: 600px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #64748b;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
    z-index: 1000;
    max-width: 400px;
}

.success-message h3 {
    color: #10b981;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.success-message p {
    color: #64748b;
    margin-bottom: 20px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}


