/* ========== Agenda Page ========== */
/* Header */
.agenda-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.agenda-date-nav {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 4px;
}

.date-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.date-nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.date-nav-btn svg {
    width: 16px;
    height: 16px;
}

.date-nav-current {
    padding: 0 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
    text-align: center;
}

.btn-add-agenda {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent), #254bbf);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(48, 92, 222, 0.2);
}

.btn-add-agenda:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(48, 92, 222, 0.3);
}

.btn-add-agenda svg {
    width: 18px;
    height: 18px;
}

/* Agenda Grid Layout */
.agenda-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

/* Timeline View (Left) */
.agenda-timeline-view {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    position: relative;
    padding: 20px 0;
    overflow: hidden;
    min-height: 600px;
}

.timeline-hour-row {
    display: flex;
    height: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.timeline-hour-row:last-child {
    border-bottom: none;
}

.timeline-time-label {
    width: 60px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    transform: translateY(-8px);
    /* Line up with border */
}

.timeline-grid-cell {
    flex: 1;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    cursor: crosshair;
    transition: background var(--transition);
}

.timeline-grid-cell:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Current Time Line */
.timeline-current-time {
    position: absolute;
    left: 60px;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.timeline-current-time::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Event Cards */
.agenda-events-container {
    position: absolute;
    top: 20px;
    /* Offset for padding */
    left: 60px;
    right: 20px;
    bottom: 20px;
    pointer-events: none;
    /* Let clicks pass through to grid cells, except on cards */
}

.agenda-event-card {
    position: absolute;
    left: 10px;
    right: 10px;
    background: rgba(48, 92, 222, 0.15);
    border: 1px solid rgba(48, 92, 222, 0.3);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 6px 10px;
    backdrop-filter: blur(4px);
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.agenda-event-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    z-index: 11;
}

.agenda-event-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.agenda-event-time {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Sidebar (Right) */
.agenda-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Mini Calendar */
.mini-calendar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px;
}

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

.mini-cal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.mini-cal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.mini-cal-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.mini-cal-btn svg {
    width: 14px;
    height: 14px;
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.mini-cal-day-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.mini-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.mini-cal-day:hover:not(.empty) {
    background: rgba(255, 255, 255, 0.08);
}

.mini-cal-day.empty {
    cursor: default;
}

.mini-cal-day.other-month {
    color: rgba(255, 255, 255, 0.2);
}

.mini-cal-day.today {
    color: var(--accent);
    font-weight: 700;
}

.mini-cal-day.selected {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Agenda Task List Outline */
.agenda-tasks-summary {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px;
}

.agenda-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.agenda-tasks-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.agenda-tasks-link {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

.agenda-tasks-link:hover {
    color: #254bbf;
}

.agenda-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.agenda-task-item:last-child {
    border-bottom: none;
}

.agenda-task-item .task-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border-width: 1px;
}

.agenda-task-item .task-checkbox svg {
    width: 10px;
    height: 10px;
}

.agenda-task-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom Select Dropdown (Vanilla JS) */
.custom-select-wrapper {
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color var(--transition);
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--accent);
}

.custom-select-trigger svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease;
}

.custom-select-wrapper.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.custom-select-wrapper.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-search {
    padding: 8px;
    border-bottom: 1px solid var(--card-border);
}

.custom-select-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
}

.custom-select-search input:focus {
    border-color: rgba(255, 255, 255, 0.1);
}

.custom-select-options {
    max-height: 200px;
    overflow-y: auto;
}

.custom-select-options::-webkit-scrollbar {
    width: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.custom-option {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.custom-option.selected {
    background: rgba(48, 92, 222, 0.1);
    color: var(--accent);
}

.custom-option-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Focus Checkbox */
.agenda-focus-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agenda-focus-toggle .form-check-input {
    width: 18px;
    height: 18px;
    accent-color: #f59e0b;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Event Card Layout */
.agenda-event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 2px;
}

.agenda-event-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-event-tag {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Focus Event Card */
.agenda-event-focus-card {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.agenda-event-focus {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.agenda-event-focus svg {
    width: 14px;
    height: 14px;
    stroke: #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.5));
}

/* Agenda Responsive */
@media (max-width: 992px) {
    .agenda-content-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .agenda-header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .agenda-date-nav {
        justify-content: center;
    }

    .btn-add-agenda {
        justify-content: center;
    }
}

/* Recurrence Styles */
.agenda-recurrence-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recurrence-days {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.day-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.day-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.day-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.agenda-event-recurrence {
    display: flex;
    align-items: center;
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.7);
}

.agenda-event-recurrence svg {
    width: 12px;
    height: 12px;
}