/* calendar.css - macOS Calendar App Styling */
.calendar-window {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.calendar-container {
    display: flex;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    background: rgba(255, 255, 255, 0.95);
}

/* Sidebar */
.calendar-sidebar {
    width: 240px;
    background: rgba(248, 248, 248, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    overflow-y: auto;
    user-select: none;
}

.calendar-mini {
    padding: 0 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.mini-title {
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.mini-nav {
    display: flex;
    gap: 10px;
}

.mini-nav-btn {
    background: transparent;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}

.mini-nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.mini-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    margin-bottom: 5px;
}

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

.mini-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
}

.mini-day:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mini-day.today {
    background: #007AFF;
    color: white;
    font-weight: 500;
}

.mini-day.selected {
    background: rgba(0, 122, 255, 0.2);
    color: #007AFF;
    font-weight: 500;
}

.mini-day.other-month {
    color: #ccc;
}

.mini-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #007AFF;
}

/* Calendars List */
.calendars-section {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: #6d6d6d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.calendar-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}

.calendar-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.calendar-name {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.calendar-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.calendar-item.active .calendar-checkbox {
    background: #007AFF;
    border-color: #007AFF;
}

.calendar-item.active .calendar-checkbox i {
    display: block;
}

/* Quick Actions */
.quick-actions {
    padding: 15px;
}

.action-link {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: #007AFF;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
}

.action-link:hover {
    background: rgba(0, 122, 255, 0.1);
}

.action-link i {
    margin-right: 10px;
    font-size: 14px;
}

/* Main Content */
.calendar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
.calendar-toolbar {
    height: 56px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
    position: relative;
    z-index: 10;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.toolbar-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #424242;
    font-size: 14px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.toolbar-btn.today-btn {
    width: auto;
    padding: 0 15px;
    background: #007AFF;
    color: white;
    font-weight: 500;
    font-size: 13px;
}

.toolbar-btn.today-btn:hover {
    background: #0051b3;
}

.view-controls {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 2px;
    margin-left: 10px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.view-btn:hover {
    color: #000;
}

.view-btn.active {
    background: white;
    color: #007AFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.date-display {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin-left: 15px;
}

.search-container {
    min-width: 200px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 6px 12px 6px 32px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    font-size: 13px;
}

.search-input:focus {
    outline: none;
    border-color: #007AFF;
    background: white;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 13px;
}

/* Calendar Views */
.calendar-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: white;
}

/* Month View */
.month-view {
    display: none;
    height: 100%;
}

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

.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    position: sticky;
    top: 0;
    z-index: 5;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(120px, auto);
    background: white;
}

.month-cell {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px;
    min-height: 120px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.month-cell:nth-child(7n) {
    border-right: none;
}

.month-cell:hover {
    background: rgba(0, 122, 255, 0.02);
}

.month-cell.today {
    background: rgba(0, 122, 255, 0.05);
}

.month-cell.selected {
    background: rgba(0, 122, 255, 0.1);
}

.cell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.cell-date {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.today .cell-date {
    width: 24px;
    height: 24px;
    background: #007AFF;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-event-btn {
    background: transparent;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.month-cell:hover .add-event-btn {
    opacity: 1;
}

.add-event-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #007AFF;
}

.cell-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 80px;
    overflow-y: auto;
}

.cell-event {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.2s;
}

.cell-event:hover {
    transform: scale(1.02);
}

.event-more {
    font-size: 10px;
    color: #999;
    text-align: center;
    margin-top: 2px;
}

/* Week View */
.week-view {
    display: none;
    height: 100%;
    overflow-x: auto;
}

.week-view.active {
    display: flex;
    flex-direction: column;
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    position: sticky;
    top: 0;
    z-index: 5;
}

.week-header-cell {
    padding: 10px;
    text-align: center;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

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

.week-day {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

.week-date {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.week-date.today {
    color: #007AFF;
}

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

.time-column {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.time-slot {
    height: 60px;
    padding: 5px;
    font-size: 11px;
    color: #999;
    text-align: right;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.day-column {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

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

.day-slot {
    height: 60px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    position: relative;
}

.day-slot:hover {
    background: rgba(0, 122, 255, 0.02);
}

.week-event {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 4px 6px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    z-index: 10;
}

/* Day View */
.day-view {
    display: none;
    height: 100%;
    overflow-y: auto;
}

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

.day-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    position: sticky;
    top: 0;
    z-index: 5;
}

.day-title {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    margin-bottom: 5px;
}

.day-subtitle {
    font-size: 14px;
    color: #666;
}

.day-timeline {
    padding: 20px;
}

.timeline-hour {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    min-height: 60px;
}

.hour-label {
    width: 80px;
    font-size: 12px;
    color: #999;
    padding-top: 8px;
}

.hour-events {
    flex: 1;
    position: relative;
}

.day-event {
    margin-bottom: 8px;
    padding: 12px 15px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.day-event:hover {
    transform: translateX(5px);
}

.event-time {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.event-title {
    font-size: 14px;
    font-weight: 500;
}

.event-location {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Year View */
.year-view {
    display: none;
    padding: 20px;
    overflow-y: auto;
}

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

.year-header {
    margin-bottom: 30px;
}

.year-title {
    font-size: 36px;
    font-weight: 700;
    color: #000;
}

.year-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.year-month {
    background: rgba(248, 248, 248, 0.5);
    border-radius: 8px;
    padding: 15px;
}

.year-month-name {
    font-size: 16px;
    font-weight: 600;
    color: #007AFF;
    margin-bottom: 15px;
    cursor: pointer;
}

.year-month-name:hover {
    text-decoration: underline;
}

.year-month-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 11px;
    text-align: center;
}

.year-weekday {
    color: #999;
    font-weight: 600;
    padding: 4px 0;
}

.year-day {
    padding: 4px 0;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
}

.year-day:hover {
    background: rgba(0, 122, 255, 0.1);
}

.year-day.today {
    background: #007AFF;
    color: white;
}

.year-day.has-events {
    font-weight: 600;
    color: #007AFF;
}

/* Event Modal */
.event-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90vw;
    z-index: 11000;
    display: none;
    animation: modalAppear 0.3s ease-out;
}

.event-modal.active {
    display: block;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #007AFF;
}

.datetime-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.calendar-select {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: white;
}

.color-options {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option.selected {
    border-color: #000;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: none;
}

.modal-btn-primary {
    background: #007AFF;
    color: white;
}

.modal-btn-primary:hover {
    background: #0051b3;
}

.modal-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.modal-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Notifications */
.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 12000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.notification.success {
    background: #34C759;
}

.notification.error {
    background: #FF3B30;
}

.notification.info {
    background: #007AFF;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .year-months {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .calendar-sidebar {
        display: none;
    }
    
    .year-months {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .toolbar-group {
        display: none;
    }
    
    .date-display {
        font-size: 16px;
    }
    
    .year-months {
        grid-template-columns: 1fr;
    }
    
    .month-grid {
        grid-auto-rows: minmax(80px, auto);
    }
    
    .cell-events {
        display: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .calendar-window {
        background: rgba(30, 30, 30, 0.98) !important;
    }
    
    .calendar-container {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .calendar-sidebar {
        background: rgba(40, 40, 40, 0.95);
        border-right-color: rgba(255, 255, 255, 0.1);
    }
    
    .mini-day {
        color: #fff;
    }
    
    .mini-day.other-month {
        color: #666;
    }
    
    .calendar-name {
        color: #fff;
    }
    
    .month-cell {
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .cell-date {
        color: #fff;
    }
    
    .month-cell.today {
        background: rgba(0, 122, 255, 0.15);
    }
    
    .year-day {
        color: #fff;
    }
    
    .form-input {
        background: #333;
        border-color: #444;
        color: #fff;
    }
} 