/* Calendar Styles */
.calendar-root {
    display: grid;
    gap: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.weekday-header {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: #374151;
    border-right: 1px solid #e5e7eb;
}

.weekday-header:last-child {
    border-right: none;
}

.day-cell {
    border: 1px solid #e5e7eb;
    min-height: 110px;
    padding: 0.5rem;
    position: relative;
    background-color: white;
    transition: background-color 0.2s;
}

.day-cell:hover {
    background-color: #f9fafb;
}

.day-cell.today {
    background-color: #eff6ff;
    border-color: #3b82f6;
}

.day-cell.other-month {
    background-color: #f9fafb;
    color: #9ca3af;
}

.day-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.day-label.today {
    color: #3b82f6;
    font-weight: 600;
}

.event-chip {
    display: block;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    margin: 0.25rem 0;
    border-radius: 0.35rem;
    background: #dbeafe;
    color: #1e40af;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #bfdbfe;
}

.event-chip:hover {
    background: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-chip.all-day {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.event-chip.all-day:hover {
    background: #fde68a;
}

.event-chip.recurring::after {
    content: "↻";
    margin-left: 0.25rem;
    opacity: 0.7;
}

/* Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1000;
}

.modal[aria-hidden="false"] {
    display: flex;
}

.modal .modal-content {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    width: min(680px, 92vw);
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Week View Styles */
.calendar-week {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr);
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.week-time-header {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: #374151;
}

.week-day-header {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: #374151;
    border-right: 1px solid #e5e7eb;
}

.week-day-header:last-child {
    border-right: none;
}

.week-time-slot {
    border-bottom: 1px solid #f3f4f6;
    padding: 0.5rem;
    min-height: 60px;
    position: relative;
}

.week-event {
    position: absolute;
    left: 2px;
    right: 2px;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: #1e40af;
    overflow: hidden;
    cursor: pointer;
    z-index: 10;
}

.week-event:hover {
    background: #bfdbfe;
    transform: scale(1.02);
}

/* List View Styles */
.calendar-list {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.list-event {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.list-event:hover {
    background-color: #f9fafb;
}

.list-event:last-child {
    border-bottom: none;
}

.list-event-time {
    min-width: 120px;
    font-weight: 500;
    color: #374151;
}

.list-event-title {
    flex: 1;
    font-weight: 500;
    color: #111827;
}

.list-event-location {
    color: #6b7280;
    font-size: 0.875rem;
}

.list-event-actions {
    display: flex;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.25rem;
    }
    
    .day-cell {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .event-chip {
        font-size: 0.7rem;
        padding: 0.15rem 0.25rem;
    }
    
    .modal .modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.calendar-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: #6b7280;
}

/* Calendar Error State */
.calendar-error {
    text-align: center;
    padding: 2rem;
}

/* Importance-based Event Colors */
.event-chip.importance-low {
    background-color: #10b981;
    color: white;
    border-left: 4px solid #059669;
}

.event-chip.importance-normal {
    background-color: #3b82f6;
    color: white;
    border-left: 4px solid #2563eb;
}

.event-chip.importance-high {
    background-color: #f59e0b;
    color: white;
    border-left: 4px solid #d97706;
}

.event-chip.importance-critical {
    background-color: #ef4444;
    color: white;
    border-left: 4px solid #dc2626;
}

/* Week view importance colors */
.week-event.importance-low {
    background-color: #10b981;
    color: white;
    border-left: 3px solid #059669;
}

.week-event.importance-normal {
    background-color: #3b82f6;
    color: white;
    border-left: 3px solid #2563eb;
}

.week-event.importance-high {
    background-color: #f59e0b;
    color: white;
    border-left: 3px solid #d97706;
}

.week-event.importance-critical {
    background-color: #ef4444;
    color: white;
    border-left: 3px solid #dc2626;
}

/* List view importance colors */
.list-event.importance-low {
    border-left: 4px solid #10b981;
}

.list-event.importance-normal {
    border-left: 4px solid #3b82f6;
}

.list-event.importance-high {
    border-left: 4px solid #f59e0b;
}

.list-event.importance-critical {
    border-left: 4px solid #ef4444;
}

/* Hover effects for importance colors */
.event-chip.importance-low:hover {
    background-color: #059669;
}

.event-chip.importance-normal:hover {
    background-color: #2563eb;
}

.event-chip.importance-high:hover {
    background-color: #d97706;
}

.event-chip.importance-critical:hover {
    background-color: #dc2626;
}

.week-event.importance-low:hover {
    background-color: #059669;
}

.week-event.importance-normal:hover {
    background-color: #2563eb;
}

.week-event.importance-high:hover {
    background-color: #d97706;
}

.week-event.importance-critical:hover {
    background-color: #dc2626;
}

/* Empty State */
.calendar-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: #6b7280;
    text-align: center;
    padding: 2rem;
}

.calendar-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Focus Management */
.modal:focus-within {
    outline: none;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
}

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

.modal[aria-hidden="false"] .modal-content {
    animation: fadeIn 0.2s ease-out;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reminder Modal Enhancements */
.reminder-item {
    transition: all 0.2s ease-in-out;
}

.reminder-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.snooze-dropdown {
    min-width: 200px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.snooze-dropdown button {
    transition: background-color 0.15s ease-in-out;
}

.snooze-dropdown button:hover {
    background-color: #f3f4f6;
}

.snooze-dropdown button:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.snooze-dropdown button:last-child {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Reminder description styling */
.reminder-description {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-left: 3px solid #3b82f6;
}

/* Reminder location styling */
.reminder-location {
    color: #6b7280;
    font-style: italic;
}

/* Reminder time styling */
.reminder-time {
    font-weight: 600;
    color: #1d4ed8;
}

/* Snooze button styling */
.snooze-button {
    transition: all 0.2s ease-in-out;
    position: relative;
}

.snooze-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.snooze-button:active {
    transform: translateY(0);
}

/* Notification animations */
.notification-enter {
    transform: translateX(100%);
    opacity: 0;
}

.notification-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease-out;
}

.notification-exit {
    transform: translateX(0);
    opacity: 1;
}

.notification-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in;
}
