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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
}

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

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

header h1 {
    font-size: 1.8rem;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.view-btn.active {
    background: #4a90d9;
    color: white;
    border-color: #4a90d9;
}

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

.calendar-nav button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.calendar-nav button:hover {
    background: #f0f0f0;
}

#currentDate {
    min-width: 200px;
    text-align: center;
}

/* Month View */
.month-view {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #4a90d9;
    color: white;
}

.weekdays div {
    padding: 10px;
    text-align: center;
    font-weight: 600;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.day-cell {
    min-height: 100px;
    border: 1px solid #eee;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.day-cell:hover {
    background: #f9f9f9;
}

.day-cell.other-month {
    color: #ccc;
    background: #fafafa;
}

.day-cell.today {
    background: #fff3cd;
}

.day-cell.selected {
    background: #e3f2fd;
}

.day-number {
    font-weight: 600;
    margin-bottom: 5px;
}

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

.event-dot {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: #4a90d9;
    color: white;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-dot.recurring {
    background: #9c27b0;
}

/* Week View */
.week-view {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: #4a90d9;
    color: white;
}

.week-header div {
    padding: 10px;
    text-align: center;
    font-weight: 600;
}

.week-header .today {
    background: #357abd;
}

.week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
}

.time-label {
    padding: 10px;
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.week-cell {
    min-height: 50px;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 4px;
}

.week-cell:hover {
    background: #f9f9f9;
}

/* Day View */
.day-view {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.day-view h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a90d9;
}

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

.day-event-item {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.day-event-item:hover {
    background: #e3f2fd;
}

.day-event-item .time {
    color: #666;
    font-size: 0.9rem;
}

.day-event-item .title {
    font-weight: 600;
    margin: 5px 0;
}

.day-event-item .description {
    color: #666;
    font-size: 0.9rem;
}

.day-event-item .recurrence-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    background: #9c27b0;
    color: white;
    border-radius: 12px;
    margin-top: 5px;
}

.no-events {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4a90d9;
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

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

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    padding: 10px 20px;
    background: #4a90d9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    padding: 10px 20px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

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

.btn-danger {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger:hover {
    background: #c82333;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .day-cell {
        min-height: 60px;
        padding: 4px;
    }
    
    .event-dot {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
}