/* Calendar Page Styles */

/* AGENDA Banner */
.agenda-banner {
    position: relative;
    height: 56px;
    background: #2A2E32;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 28px;
    font-weight: 700;
    color: #00E5FF;
    text-shadow: 
        0 0 10px rgba(0, 229, 255, 0.6),
        0 0 20px rgba(0, 229, 255, 0.4),
        0 0 30px rgba(0, 229, 255, 0.2);
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    z-index: 10;
}

/* Create Event Button (top right of banner) */
.create-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #00E5FF;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 16px rgba(0, 229, 255, 2.0));
    transition: filter 0.2s ease;
    padding: 0;
}

.create-btn:hover {
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 24px rgba(0, 229, 255, 2.0));
}

.create-btn span {
    display: none;
}

/* Activity Tabs - Icon Only */
.activity-tabs {
    display: flex;
    background-color: var(--bg-surface);
    border-bottom: 2px solid var(--bg-outline);
    padding: 0;
    gap: 0;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 2px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 8px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 16px rgba(0, 229, 255, 2.0));
    transition: filter 0.2s ease;
    color: #2a2e32;
    font-size: 24px;
    margin-bottom: 10px;
}

.tab-btn span {
    display: none;
}

.tab-btn.active i {
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 2.5)) drop-shadow(0 0 24px rgba(0, 229, 255, 2.5));
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.tab-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-btn:not(.disabled):hover i {
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 24px rgba(0, 229, 255, 2.0));
}

/* Tab Content */
.tab-content {
    display: none;
    flex-direction: column;
    height: calc(100vh - 56px - 60px - 60px - 12vh); /* Account for banner, tabs, controls, and drawer */
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* Calendar Controls - Now at Bottom */
.calendar-controls {
    position: fixed;
    bottom: calc(12vh + 10px);
    left: 0;
    right: 0;
    background-color: transparent;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
    pointer-events: none;
}

.calendar-controls > * {
    pointer-events: all;
}

/* Left side - Sync Status */
.sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.sync-text {
    color: var(--text-subtext);
    font-style: italic;
}

.refresh-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    color: #00E5FF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 0 2px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 8px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 16px rgba(0, 229, 255, 2.0));
    transition: filter 0.2s ease;
    padding: 0;
}

.refresh-btn:hover {
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 24px rgba(0, 229, 255, 2.0));
}

.refresh-btn span {
    display: none;
}

.refresh-btn i {
    font-size: 20px;
    color: #2a2e32;
}

.refresh-btn i.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Right side - View Selector */
.view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(42, 46, 50, 0.9);
    padding: 6px 10px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.view-select {
    background-color: transparent;
    border: none;
    color: #00E5FF;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.view-select option {
    background-color: #2A2E32;
    color: #00E5FF;
}

/* Date Navigation - Top of calendar view */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background-color: var(--bg-surface);
    padding: 12px 15px;
    border-bottom: 1px solid var(--bg-outline);
}

.nav-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 0 2px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 8px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 16px rgba(0, 229, 255, 2.0));
    transition: filter 0.2s ease;
    padding: 0;
    outline: none;
}

.nav-btn:hover:not(:disabled) {
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 24px rgba(0, 229, 255, 2.0));
}

.nav-btn:focus:not(:disabled) {
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.4);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: none;
}

.nav-btn i {
    font-size: 20px;
    color: #2a2e32;
}

.month-year-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-select {
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    padding: 4px;
}

.month-select option {
    background-color: var(--bg-surface);
}

.year-display {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-subtext);
}

/* Back Button (day view) */
#backToMonth {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 16px rgba(0, 229, 255, 2.0));
    transition: filter 0.2s ease;
    padding: 0;
}

#backToMonth:hover {
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 2.0)) drop-shadow(0 0 24px rgba(0, 229, 255, 2.0));
}

/* Calendar View Container */
.calendar-view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-background);
    padding: 15px;
}

/* Month View Grid */
.month-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.month-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-subtext);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.day-cell {
    aspect-ratio: 1;
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-outline);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.day-cell:hover {
    background-color: var(--bg-button);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.day-cell.other-month {
    opacity: 0.3;
}

.day-cell.today {
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.day-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.day-cell.today .day-number {
    color: var(--accent);
}

.event-dots {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: auto;
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 4px rgba(0, 229, 255, 0.6);
}

.event-more {
    font-size: 9px;
    color: var(--text-subtext);
    margin-top: 2px;
}

/* Week View */
.week-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    gap: 4px;
    background-color: var(--bg-surface);
    padding: 8px;
    border-bottom: 1px solid var(--bg-outline);
    position: sticky;
    top: 0;
    z-index: 10;
}

.week-header-day {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-subtext);
}

.week-header-day.today {
    color: var(--accent);
}

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

.time-label {
    font-size: 11px;
    color: var(--text-subtext);
    padding: 4px;
    text-align: right;
}

.hour-slot {
    min-height: 50px;
    border-top: 1px solid var(--bg-outline);
    position: relative;
}

/* Day View */
.day-view {
    max-width: 500px;
    margin: 0 auto;
}

.day-view-header {
    text-align: center;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--bg-outline);
}

.day-view-header.today {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.all-day-events {
    margin-bottom: 15px;
}

.all-day-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-subtext);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.day-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-hour {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 10px;
    min-height: 50px;
    border-top: 1px solid var(--bg-outline);
}

.timeline-hour:first-child {
    border-top: none;
}

/* Event Card */
.event-card {
    background-color: var(--bg-button);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 8px 10px;
    margin: 4px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.event-card:hover {
    background-color: var(--bg-surface);
    border-left-color: var(--glow-strong);
    box-shadow: 0 2px 10px rgba(0, 229, 255, 0.3);
    transform: translateX(2px);
}

.event-time {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 3px;
}

.event-title {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.event-location {
    font-size: 11px;
    color: var(--text-subtext);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-categories {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.event-category {
    font-size: 9px;
    padding: 2px 6px;
    background-color: rgba(0, 229, 255, 0.15);
    color: var(--accent);
    border-radius: 3px;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

/* Event Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: #1a1d1f;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 
        0 0 20px rgba(0, 229, 255, 0.3),
        0 0 40px rgba(0, 229, 255, 0.2);
    border: 1px solid rgba(0, 229, 255, 0.3);
    animation: modalFade 0.3s ease-out;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.modal-header h2 {
    font-size: 20px;
    color: #00E5FF;
    line-height: 1.3;
    margin: 0;
    flex: 1;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #00E5FF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    flex-shrink: 0;
}

.modal-close:hover {
    background-color: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-detail {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.event-detail i {
    width: 24px;
    font-size: 16px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.event-detail span,
.event-detail div {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

#modalEventDescription {
    white-space: pre-wrap;
}

/* Event Form */
.event-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #00E5FF;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.form-group label i {
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group textarea {
    background-color: #2a2e32;
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 8px;
    color: #b0b0b0;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #00E5FF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group label {
    flex-direction: row;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00E5FF;
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    background-color: #2a2e32;
    color: #b0b0b0;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.btn-secondary:hover {
    background-color: #3a3e42;
    border-color: #00E5FF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #00E5FF 0%, #00b8cc 100%);
    color: #1a1d1f;
    border: none;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.6);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-subtext);
    padding: 40px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--bg-outline);
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

.empty-state small {
    font-size: 13px;
    opacity: 0.7;
}

/* Error State */
.error-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--error);
    padding: 40px 20px;
}

.error-state i {
    font-size: 48px;
}

.error-state p {
    font-size: 16px;
    margin: 0;
    text-align: center;
    color: var(--text-primary);
}

.retry-btn {
    padding: 10px 24px;
    background-color: var(--accent);
    color: var(--bg-background);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background-color: var(--glow-strong);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

/* Placeholder Content (Tasks/Routines/Schedule) */
.placeholder-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-subtext);
    padding: 40px 20px;
}

.placeholder-content i {
    font-size: 64px;
    color: var(--bg-outline);
}

.placeholder-content h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin: 0;
}

.placeholder-content p {
    font-size: 14px;
    margin: 0;
}

/* Scrollbar Styling */
.calendar-view::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.calendar-view::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: var(--bg-button);
    border-radius: 3px;
}

.calendar-view::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .month-view {
        gap: 4px;
    }
    
    .day-cell {
        padding: 4px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .event-dot {
        width: 4px;
        height: 4px;
    }
    
    .agenda-banner {
        font-size: 24px;
        padding: 0 15px;
    }
    
    .view-controls {
        padding: 4px 8px;
    }
}

@media (max-height: 600px) {
    .tab-btn {
        padding: 8px 6px;
    }
    
    .tab-btn i {
        font-size: 20px;
    }
}
