/**
 * Event Calendar Component Styles
 * Vista de calendario - Desktop: Mensual compacto, Mobile: Agenda vertical
 */

/* ============================================
   DESKTOP: CALENDAR VIEW
   ============================================ */

.calendar-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 95vw;
    min-height: calc(100vh - 14rem);
    margin: 0 auto;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Vista de calendario mensual: altura fija */
.calendar-view:not(.timeline-view) {
    height: calc(100vh - 14rem);
}

/* Header */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-header-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calendar-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.calendar-view-toggle-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
    font-size: 1rem;
}

.calendar-view-toggle-btn:hover {
    color: #111827;
}

.calendar-view-toggle-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.calendar-month {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    text-transform: capitalize;
    margin: 0;
}

.calendar-month-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    text-transform: capitalize;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 150ms ease;
}

.calendar-month-selector:hover {
    background: #f3f4f6;
    color: #667eea;
}

.calendar-month-selector i {
    font-size: 1.25rem;
    transition: transform 150ms ease;
}

.calendar-month-selector:hover i {
    transform: translateY(2px);
}

.calendar-month-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.calendar-event-count {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    line-height: 1;
    margin-top: -0.125rem;
}

.calendar-download-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
    font-size: 1rem;
}

.calendar-download-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.calendar-download-btn:active {
    transform: translateY(0);
}

.calendar-nav-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
}

.calendar-nav-btn:hover {
    background: #f3f4f6;
    color: #667eea;
}

.calendar-nav-btn i {
    font-size: 1.25rem;
}

/* Grid */
.calendar-grid {
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #9ca3af;
    padding: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-days-wrapper {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    position: relative;
    flex: 1;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.625rem 0.375rem 0.25rem 0.375rem;
    background: white;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    cursor: default;
    transition: background 150ms ease;
    position: relative;
    min-height: 0;
    z-index: 1;
}

.calendar-day.has-events {
    cursor: pointer;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-events-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    pointer-events: none;
    z-index: 2;
    align-items: flex-end;
}

.calendar-day.empty {
    background: #fafafa;
    cursor: default;
}

.calendar-day:not(.empty):hover {
    background: #f9fafb;
}

.calendar-day.today {
    background: #eff6ff;
}

.calendar-day.today .calendar-day-number {
    background: #667eea;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
}

.calendar-day.has-events {
    background: #faf5ff;
}

.calendar-day.has-events:hover {
    background: #f3e8ff;
}

.calendar-day.selected {
    background: #ede9fe;
}

.calendar-day-number {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Single Day Events */
.calendar-day-events {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.125rem;
    margin-bottom: auto;
    position: relative;
    z-index: 4;
}

.calendar-event-dot {
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    transition: transform 150ms ease;
    cursor: pointer;
    position: relative;
    pointer-events: none;
}

.calendar-event-dot:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* Marca de evento multi-día */
.calendar-event-dot.multi-day {
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
}

.calendar-event-dot.multi-day:hover {
    background: #667eea;
    color: white;
}

.multi-day-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Indicador de evento recurrente */
.calendar-event-dot.recurring {
    border: 2px solid #10b981;
}

.recurring-indicator {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recurring-indicator i {
    font-size: 7px;
    color: white;
}

.calendar-more {
    font-size: 0.6875rem;
    color: #667eea;
    font-weight: 700;
    background: #ede9fe;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Event Bars - Súper delgadas */
.calendar-event-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 0.25rem;
    color: white;
    cursor: pointer;
    pointer-events: all;
    transition: all 150ms ease;
    overflow: hidden;
    white-space: nowrap;
    height: 0.375rem;
    position: relative;
    align-self: flex-end;
    margin-bottom: 0.25rem;
}

.calendar-event-bar[data-level="0"] {
    margin-bottom: 0.25rem;
}

.calendar-event-bar[data-level="1"] {
    margin-bottom: 0.875rem;
}

.calendar-event-bar[data-level="2"] {
    display: none;
}

.calendar-event-bar.rounded-start {
    border-radius: 0.25rem 0 0 0.25rem;
}

.calendar-event-bar.rounded-end {
    border-radius: 0 0.25rem 0.25rem 0;
}

.calendar-event-bar.rounded-start.rounded-end {
    border-radius: 0.25rem;
}

.calendar-event-bar:hover {
    filter: brightness(1.15);
    height: 0.5rem;
    z-index: 10;
}

.calendar-event-bar i {
    font-size: 0.625rem;
    flex-shrink: 0;
    margin-left: 0.125rem;
}



/* ============================================
   DESKTOP: TIMELINE VIEW
   ============================================ */

.timeline-view {
    max-width: 900px;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.timeline-day {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-day.today .timeline-date-header {
    color: #667eea;
}

.timeline-date-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.timeline-date-bullet {
    font-size: 1.5rem;
    color: #667eea;
}

.timeline-date-day {
    font-size: 1.125rem;
    font-weight: 700;
}

.timeline-date-weekday {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: capitalize;
}

.timeline-events-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 2.5rem;
    position: relative;
}

/* Línea vertical de la timeline */
.timeline-events-list::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e5e7eb 0%, #e5e7eb 100%);
}

.timeline-event-item {
    display: flex;
    gap: 1rem;
    position: relative;
    padding: 1rem 0;
}

.timeline-event-item:last-child {
    padding-bottom: 0;
}

.timeline-event-icon {
    position: absolute;
    left: -2.25rem;
    top: 1.25rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Estilos para eventos recurrentes en timeline */
.timeline-event-icon .recurring-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-event-icon .recurring-badge i {
    font-size: 8px;
    color: white;
}

.timeline-event-time .recurring-label {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.timeline-event-card {
    flex: 1;
    display: flex;
    gap: 1rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
}

.timeline-event-card:hover {
    transform: translateX(4px);
}

.timeline-event-card:hover .timeline-event-content {
    background: #f9fafb;
}

.timeline-event-image {
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.timeline-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.5rem 0;
    transition: all 150ms ease;
}

.timeline-event-time {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #667eea;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.timeline-event-name {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
}

.timeline-event-description {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-event-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.timeline-event-location i {
    font-size: 0.8125rem;
}

.timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.timeline-empty i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.timeline-empty p {
    font-size: 1rem;
    color: #9ca3af;
    margin: 0;
}

/* ============================================
   MOBILE: AGENDA VIEW
   ============================================ */

.agenda-view {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0 -1.5rem;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Toggle Próximos/Pasados */
.agenda-toggle {
    display: flex;
    justify-content: flex-end !important;
    align-items: center;
    padding: 1rem 1rem 0.75rem 1rem;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 3rem;
    overflow: visible;
    max-width: 100%;
    box-sizing: border-box;
}

.agenda-toggle-group {
    display: flex;
    background: transparent;
    border-radius: 0.375rem;
    margin-left: auto;
    flex-shrink: 0;
}

.agenda-toggle-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 4.5rem;
    text-align: center;
}

.agenda-toggle-btn:first-child {
    border-radius: 0.375rem 0 0 0.375rem;
}

.agenda-toggle-btn:last-child {
    border-radius: 0 0.375rem 0.375rem 0;
}

.agenda-toggle-btn.active {
    background: #f3f4f6;
    color: #111827;
}

.agenda-toggle-btn:hover:not(.active) {
    color: #6b7280;
}

/* Día */
.agenda-day {
    display: flex;
    flex-direction: column;
    background: transparent;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.agenda-day:last-child {
    border-bottom: none;
}

/* Header del día minimalista */
.agenda-date-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.agenda-date-bullet {
    font-size: 1.25rem;
    color: #d1d5db;
    line-height: 1;
}

.agenda-date-day {
    font-weight: 700;
    color: #111827;
}

.agenda-date-weekday {
    color: #9ca3af;
    text-transform: lowercase;
}

/* Lista de eventos con timeline */
.agenda-events-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 3rem;
    margin-left: 0.75rem;
}

.agenda-events-list::before {
    content: '';
    position: absolute;
    left: 0.875rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(180deg, #667eea 0%, #e5e7eb 100%);
}

.agenda-event-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
}

.agenda-event-item:hover {
    transform: translateX(4px);
}

.agenda-event-icon {
    position: absolute;
    left: -2.5rem;
    top: 0.75rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    box-shadow: 0 0 0 3px white;
    z-index: 1;
}

/* Badge de evento recurrente en agenda */
.recurring-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recurring-badge i {
    font-size: 8px;
    color: white;
}

.recurring-label {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.agenda-event-details {
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - 7rem);
    overflow: hidden;
}

.agenda-event-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.agenda-event-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.375rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.agenda-event-description {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.agenda-event-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.agenda-event-location i {
    font-size: 0.875rem;
    color: #9ca3af;
}

.agenda-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    margin: 1.5rem;
}

.agenda-empty i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.agenda-empty p {
    color: #6b7280;
    margin: 0;
}

/* Day Modal */
.day-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 200ms ease;
    padding: 1rem;
}

.day-modal-panel {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 340px;
    width: 100%;
    max-height: 55vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.day-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.day-modal-date {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
}

.day-modal-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.day-modal-date-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.day-modal-weekday {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.2;
}

.day-modal-month {
    font-size: 0.6875rem;
    opacity: 0.9;
    text-transform: capitalize;
    line-height: 1.2;
}

.day-modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 150ms ease;
    font-size: 1rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.day-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.day-modal-content {
    overflow-y: auto;
    padding: 0.875rem;
    flex: 1;
    min-height: 0;
}

.day-modal-events {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.day-modal-event {
    display: flex;
    gap: 0.625rem;
    padding: 0.625rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 150ms ease;
}

.day-modal-event:hover {
    background: #f3f4f6;
    transform: translateX(2px);
}

.day-modal-event-image {
    width: 60px;
    height: 60px;
    border-radius: 0.375rem;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.day-modal-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.day-modal-event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.day-modal-event-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.day-modal-event-category {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.3125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.6875rem;
    flex-shrink: 0;
    position: relative;
}

/* Estilos para eventos recurrentes en modal del día */
.recurring-badge-small {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 1px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recurring-badge-small i {
    font-size: 6px;
    color: white;
}

.day-modal-event-time .recurring-label {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 0.0625rem 0.25rem;
    border-radius: 0.1875rem;
    margin-left: 0.375rem;
    text-transform: uppercase;
}

.day-modal-event-time {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #667eea;
    line-height: 1.2;
}

.day-modal-event-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.day-modal-event-description {
    font-size: 0.6875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.day-modal-event-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    color: #9ca3af;
    line-height: 1.2;
}

.day-modal-event-location i {
    font-size: 0.6875rem;
    flex-shrink: 0;
}

/* Month Picker */
.month-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 200ms ease;
}

.month-picker-panel {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 380px;
    width: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.month-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.month-picker-column {
    display: flex;
    flex-direction: column;
}

.month-picker-column:first-child {
    border-right: 1px solid #e5e7eb;
}

.month-picker-column-header {
    padding: 0.875rem;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.month-picker-years,
.month-picker-months {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 320px;
    overflow-y: auto;
}

.month-picker-year-btn,
.month-picker-month-btn {
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
    text-align: center;
}

.month-picker-year-btn:hover,
.month-picker-month-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.month-picker-year-btn.selected,
.month-picker-month-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.month-picker-month-btn.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.5;
}

.month-picker-month-btn.disabled:hover {
    background: transparent;
    color: #d1d5db;
}

.month-picker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid #e5e7eb;
}

.month-picker-action-btn {
    padding: 0.875rem;
    border: none;
    background: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.month-picker-action-btn.secondary {
    color: #6b7280;
    border-right: 1px solid #e5e7eb;
}

.month-picker-action-btn.secondary:hover {
    background: #f9fafb;
    color: #111827;
}

.month-picker-action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.month-picker-action-btn.primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.month-picker-action-btn i {
    font-size: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .calendar-view {
        padding: 1rem;
    }

    .calendar-header {
        margin-bottom: 1rem;
    }

    .calendar-month {
        font-size: 1.125rem;
    }

    .calendar-weekday {
        font-size: 0.625rem;
        padding: 0.375rem 0;
    }

    .calendar-day {
        padding: 0.375rem 0.125rem;
        min-height: 55px;
    }

    .calendar-day-number {
        font-size: 0.8125rem;
    }

    .calendar-day.today .calendar-day-number {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.75rem;
    }



    .calendar-event-dot {
        width: 1rem;
        height: 1rem;
        font-size: 0.5rem;
    }

    .calendar-more {
        font-size: 0.5625rem;
        padding: 0.0625rem 0.25rem;
    }

    .calendar-event-bar {
        height: 0.3125rem;
    }

    .calendar-event-bar:hover {
        height: 0.4375rem;
    }

    .calendar-event-bar i {
        font-size: 0.5rem;
    }

    .calendar-event-bar[data-level="0"] {
        margin-bottom: 0.1875rem;
    }

    .calendar-event-bar[data-level="1"] {
        margin-bottom: 0.6875rem;
    }
}

@media (max-width: 480px) {
    .agenda-view {
        margin: 0 -0.75rem;
    }

    .agenda-toggle {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    }

    .agenda-toggle-group {
        border-radius: 0.375rem;
    }

    .agenda-toggle-btn {
        padding: 0.3125rem 0.625rem;
        font-size: 0.6875rem;
        min-width: 4rem;
    }
    
    .mobile-calendar-view {
        padding: 0.625rem;
        margin: 0 -0.125rem;
    }
    
    .mobile-calendar-header {
        gap: 0.25rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.625rem;
    }
    
    .mobile-view-toggle {
        padding: 0.15rem;
        gap: 0.1rem;
    }
    
    .mobile-view-toggle-btn {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }
    
    .mobile-calendar-month-name {
        font-size: 0.9375rem;
    }
    
    .mobile-calendar-event-count {
        font-size: 0.625rem;
    }
    
    .mobile-calendar-weekday {
        font-size: 0.5625rem;
        padding: 0.25rem 0;
    }
    
    .mobile-calendar-days {
        gap: 0.0625rem;
    }
    
    .mobile-calendar-day {
        padding: 0.0625rem;
        border-radius: 0.25rem;
    }
    
    .mobile-calendar-day-number {
        font-size: 0.6875rem;
    }
    
    .mobile-calendar-day.today .mobile-calendar-day-number {
        width: 1.125rem;
        height: 1.125rem;
        font-size: 0.625rem;
    }
    
    .mobile-calendar-dot {
        width: 0.25rem;
        height: 0.25rem;
    }
    
    .mobile-calendar-more {
        font-size: 0.4375rem;
    }

    .agenda-day {
        padding: 1.25rem 1rem;
    }

    .agenda-date-header {
        font-size: 0.8125rem;
    }

    .agenda-date-bullet {
        font-size: 1.125rem;
    }

    .agenda-event-item {
        padding: 0.625rem;
        gap: 0.75rem;
    }

    .agenda-event-time {
        font-size: 0.8125rem;
        min-width: 2.75rem;
    }

    .agenda-event-name {
        font-size: 0.875rem;
    }

    .agenda-event-info {
        font-size: 0.6875rem;
    }

    .agenda-events-list {
        padding-left: 2.75rem;
        margin-left: 0.5rem;
    }

    .agenda-events-list::before {
        left: 0.75rem;
    }

    .agenda-event-details {
        max-width: calc(100vw - 6rem);
    }

    .agenda-event-item {
        padding: 0.625rem 0;
    }

    .agenda-event-icon {
        left: -2.25rem;
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

    .agenda-event-time {
        font-size: 0.6875rem;
    }

    .agenda-event-name {
        font-size: 0.875rem;
    }

    .agenda-event-description {
        font-size: 0.75rem;
    }

    .agenda-event-location {
        font-size: 0.6875rem;
    }

    /* Month picker mobile */
    .month-picker-panel {
        max-width: 95%;
        border-radius: 1rem;
    }

    .month-picker-column-header {
        padding: 1rem;
        font-size: 0.6875rem;
    }

    .month-picker-years,
    .month-picker-months {
        padding: 0.75rem;
        gap: 0.375rem;
        max-height: 300px;
    }

    .month-picker-year-btn,
    .month-picker-month-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
    }

    .month-picker-actions {
        gap: 0;
    }

    .month-picker-action-btn {
        padding: 0.875rem;
        font-size: 0.875rem;
    }

    .month-picker-action-btn i {
        font-size: 1rem;
    }
    
    /* Day modal mobile */
    .day-modal-overlay {
        padding: 0.75rem;
    }
    
    .day-modal-panel {
        max-width: 90%;
        max-height: 60vh;
        border-radius: 0.625rem;
    }
    
    .day-modal-header {
        padding: 0.75rem 0.875rem;
    }
    
    .day-modal-day {
        font-size: 1.375rem;
    }
    
    .day-modal-date {
        gap: 0.5rem;
    }
    
    .day-modal-weekday {
        font-size: 0.75rem;
    }
    
    .day-modal-month {
        font-size: 0.625rem;
    }
    
    .day-modal-close {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
        margin-left: 0.375rem;
    }
    
    .day-modal-content {
        padding: 0.75rem;
    }
    
    .day-modal-events {
        gap: 0.5rem;
    }
    
    .day-modal-event {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .day-modal-event-image {
        width: 50px;
        height: 50px;
    }
    
    .day-modal-event-category {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.625rem;
    }
    
    .day-modal-event-time {
        font-size: 0.625rem;
    }
    
    .day-modal-event-name {
        font-size: 0.8125rem;
    }
    
    .day-modal-event-description {
        font-size: 0.625rem;
    }
    
    .day-modal-event-location {
        font-size: 0.5625rem;
    }
    
    .day-modal-event-location i {
        font-size: 0.625rem;
    }
}

/* ============================================
   MOBILE: CALENDAR VIEW
   ============================================ */

.mobile-calendar-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow-x: hidden;
    touch-action: pan-y;
    position: relative;
}

/* Animación de swipe */
.mobile-calendar-view.swipe-transition {
    transition: transform 150ms cubic-bezier(0.4, 0, 0.6, 1);
}

.mobile-calendar-view.swipe-left {
    animation: swipeOutLeft 150ms cubic-bezier(0.4, 0, 0.6, 1);
}

.mobile-calendar-view.swipe-right {
    animation: swipeOutRight 150ms cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes swipeOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0.3;
        transform: translateX(-20px);
    }
}

@keyframes swipeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0.3;
        transform: translateX(20px);
    }
}

.mobile-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow: visible;
}

.mobile-calendar-month {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.mobile-calendar-month-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    text-transform: capitalize;
}

.mobile-calendar-event-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.mobile-calendar-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-view-toggle {
    display: flex;
    gap: 0.125rem;
    background: #f3f4f6;
    padding: 0.2rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.mobile-view-toggle-btn {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.mobile-view-toggle-btn:hover {
    color: #111827;
}

.mobile-view-toggle-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mobile-calendar-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

.mobile-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.125rem;
    margin-bottom: 0.375rem;
    width: 100%;
}

.mobile-calendar-weekday {
    text-align: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: #6b7280;
    padding: 0.375rem 0;
}

.mobile-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.125rem;
    width: 100%;
}

.mobile-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.125rem;
    border-radius: 0.375rem;
    background: #f9fafb;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.mobile-calendar-day.empty {
    background: transparent;
    cursor: default;
}

.mobile-calendar-day.today {
    background: #ede9fe;
    border: 2px solid #667eea;
}

.mobile-calendar-day.has-events {
    background: #f3f4f6;
}

.mobile-calendar-day.has-events:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

.mobile-calendar-day-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.0625rem;
    line-height: 1;
}

.mobile-calendar-day.today .mobile-calendar-day-number {
    color: #667eea;
    background: #ede9fe;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-calendar-day-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.0625rem;
    margin-top: auto;
    flex-wrap: wrap;
    max-width: 100%;
}

.mobile-calendar-dot {
    width: 0.3125rem;
    height: 0.3125rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.mobile-calendar-more {
    font-size: 0.5rem;
    font-weight: 600;
    color: #6b7280;
    margin-left: 0.0625rem;
    line-height: 1;
}

/* Agenda header controls */
.agenda-header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.agenda-toggle {
    display: flex;
}

/* Reducir padding del mobile-view-toggle para que esté más pegado */
.agenda-header-controls .mobile-view-toggle {
    padding: 0.25rem;
    margin-right: 0;
}

/* Rango de fechas para eventos multi-día */
.timeline-date-info,
.agenda-date-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.timeline-date-range,
.agenda-date-range {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

/* Infinite scroll indicators */
.agenda-content {
    position: relative;
}

.agenda-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.agenda-loading i {
    font-size: 1.25rem;
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.agenda-scroll-sentinel {
    height: 1px;
    width: 100%;
}

.agenda-end-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: center;
}

.agenda-end-message i {
    font-size: 1.25rem;
    color: #10b981;
}

.rotating {
    animation: rotate 1s linear infinite;
}
