/* Reset and Base Styles */
* {
    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%);
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-month {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    min-width: 200px;
    text-align: center;
}

.view-controls {
    display: flex;
    gap: 10px;
}

/* Button Styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 45px;
    height: 45px;
    padding: 0;
    justify-content: center;
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-icon:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn-view {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-view.active,
.btn-view:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Calendar Container */
.calendar-container {
    position: relative;
    margin-bottom: 30px;
}

.calendar-view {
    display: none;
}

.calendar-view.active {
    display: block;
}

/* Month View */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.weekday {
    background: #f8fafc;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #64748b;
    font-size: 14px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day:hover {
    background: #f8fafc;
}

.calendar-day.other-month {
    background: #f8fafc;
    color: #94a3b8;
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calendar-day.selected {
    background: #10b981;
    color: white;
}

.day-number {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-dot {
    height: 4px;
    border-radius: 2px;
    margin-bottom: 2px;
    font-size: 10px;
    padding: 2px 4px;
    color: white;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Week View */
.week-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.time-column,
.day-column {
    background: #f8fafc;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #64748b;
}

.week-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
}

.time-slot {
    background: white;
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    min-height: 60px;
    position: relative;
}

.time-slot:first-child {
    border-top: none;
}

.time-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.week-event {
    position: absolute;
    left: 5px;
    right: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: white;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    z-index: 10;
}

/* Day View */
.day-timeline {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
}

.day-time-slot {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    min-height: 80px;
    position: relative;
}

.day-time-label {
    width: 80px;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.day-event {
    margin-left: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Event Panel */
.event-panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.panel-header h3 {
    font-size: 20px;
    color: #1e293b;
    font-weight: 600;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-item:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.event-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-info {
    flex: 1;
}

.event-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.event-time {
    font-size: 12px;
    color: #64748b;
}

.event-actions {
    display: flex;
    gap: 8px;
}

.event-actions button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #10b981;
    color: white;
}

.edit-btn:hover {
    background: #059669;
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.modal-header h3 {
    font-size: 24px;
    color: #1e293b;
    font-weight: 600;
}

.modal-close {
    width: 35px;
    height: 35px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.color-picker {
    display: flex;
    gap: 10px;
}

.color-picker input[type="radio"] {
    display: none;
}

.color-option {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.color-picker input[type="radio"]:checked + .color-option {
    border-color: #1e293b;
    transform: scale(1.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #64748b;
    font-size: 14px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .current-month {
        font-size: 24px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 8px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .event-dot {
        font-size: 9px;
        padding: 1px 3px;
    }
    
    .week-header,
    .week-grid {
        grid-template-columns: 60px repeat(7, 1fr);
    }
    
    .time-column,
    .day-column {
        padding: 10px;
        font-size: 12px;
    }
    
    .time-slot {
        padding: 8px;
        min-height: 50px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}

/* Drag and Drop Styles */
.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drop-zone {
    background: #f0f9ff;
    border: 2px dashed #0ea5e9;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

.calendar-day,
.event-item {
    animation: fadeIn 0.3s ease;
}