/* KEYFRAMES */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in-animate {
    animation: fadeIn 1s ease-in-out;
}

/* UTILITY CLASSES */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    background-color: #f9fafb;
}

.calendar-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.main-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--daikin-dark-navy);
    margin: 0 0 2rem 0;
}

.content-grid {
    display: grid;
    gap: 2rem;
    align-items: flex-start;
}

/* SIDEBAR */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
}

.sidebar-title-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--daikin-dark-navy);
    margin: 0;
}

.sidebar-subtitle-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0.25rem 0 0 0;
}

.sidebar-content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 800px;
    overflow-y: auto;
}

/* EVENT FILTER */
.event-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* BUTTON STYLES (from Button.tsx) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn:focus-visible {
    outline: 2px solid var(--daikin-blue);
    outline-offset: 2px;
}

.btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Sizes */
.btn-size-default {
    height: 2.5rem;
    padding: 0.5rem 1rem;
}

.btn-size-sm {
    height: 2.25rem;
    padding: 0 0.75rem;
}

.btn-size-icon {
    height: 2.5rem;
    width: 2.5rem;
}

.btn-size-sm-icon {
    height: 2rem;
    width: 2rem;
    padding: 0;
}

/* Variants */
.btn-variant-default {
    background-color: var(--daikin-blue);
    color: var(--white);
    border-color: var(--daikin-blue);
}

.btn-variant-default:hover {
    background-color: var(--daikin-dark-navy);
}

.btn-variant-outline {
    border-color: var(--gray-200);
    background-color: var(--white);
}

.btn-variant-outline:hover {
    background-color: var(--gray-50);
    color: var(--gray-900);
}

.btn-variant-ghost {
    background-color: transparent;
}

.btn-variant-ghost:hover {
    background-color: var(--gray-50);
    color: var(--gray-900);
}

/* CALENDAR (from ModernCalendar.tsx) */
.calendar-wrapper {
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.calendar-nav {
    display: flex;
    gap: 0.25rem;
}

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

.calendar-day-header {
    background-color: #f9fafb;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day-header:last-child {
    border-right: 0;
}

.calendar-day-cell {
    min-height: 8rem;
    padding: 0.5rem;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-day-cell:nth-child(7n) {
    border-right: 0;
}

.calendar-day-cell:last-child {
    border-bottom: 0;
}

.calendar-day-cell.empty {
    background-color: #f9fafb;
    cursor: default;
}

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

.calendar-day-cell.selected {
    background-color: #eff6ff;
    box-shadow: inset 0 0 0 2px var(--daikin-blue);
}

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

.day-number.today {
    color: var(--daikin-blue);
    font-weight: 700;
}

.day-events-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 5rem;
}

.event-dots-container {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.event-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.dot-event {
    background-color: var(--daikin-blue);
}

.dot-training {
    background-color: var(--flamingo-orange);
}

.show-more-btn {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.25rem;
    border-radius: 0.375rem;
    background-color: #f3f4f6;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.show-more-btn:hover {
    background-color: #e5e7eb;
}

.show-more-btn svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* CALENDAR EVENT (from CalendarEvent.tsx & CompactCalendarEvent.tsx) */
.calendar-event,
.compact-calendar-event {
    color: white;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-event:hover,
.compact-calendar-event:hover {
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.calendar-event {
    font-size: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-left: 4px solid;
}

.calendar-event .title {
    font-weight: 500;
}

.calendar-event .time {
    opacity: 0.9;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.compact-calendar-event {
    font-size: 0.75rem;
    padding: 0.375rem;
    border-left: 2px solid;
}

.compact-calendar-event .title {
    font-weight: 500;
    line-height: 1.2;
}

/* Event/Training specific colors */
.event-style {
    background-color: var(--daikin-blue);
    border-color: var(--daikin-dark-navy);
}

.training-style {
    background-color: var(--flamingo-orange);
    border-color: var(--flamingo-orange-dark);
}

/* EVENT CARD (from EventCard.tsx) */
.event-card {
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: box-shadow 0.2s;
}

.event-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.event-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.event-card-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.tag-event {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.tag-training {
    background-color: rgba(242, 101, 34, 0.1);
    color: var(--flamingo-orange);
}

.event-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--daikin-dark-navy);
    margin: 0 0 0.5rem 0;
}

.event-card-description {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.event-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    color: #4b5563;
}

.detail-item svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.75rem;
}

.detail-item span {
    font-size: 0.875rem;
}

.detail-item.credits {
    color: var(--flamingo-orange);
}

.detail-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* This group keeps the calendar icon and date text together */
.date-time-group {
    display: flex;
    align-items: center;
}

.date-time-group svg {
    margin-right: 0.75rem;
}

/* This styles the "Day X" tag to look exactly like the "Trainings" pill */
.day-counter {
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

/* Duration Tag for multi-day events like "For X days"
.duration-tag {
    background-color: #e5e7eb;
    color: #4b5563;
}
*/

.event-card-footer {
    display: flex;
    justify-content: flex-end;
}

.event-card-footer .btn {
    font-family: 'Poppins', sans-serif;
}

.event-card-footer .btn-event {
    background-color: var(--daikin-blue);
}

.event-card-footer .btn-event:hover {
    background-color: var(--daikin-dark-navy);
}

.event-card-footer .btn-training {
    background-color: var(--flamingo-orange);
}

.event-card-footer .btn-training:hover {
    background-color: var(--flamingo-orange-dark);
}

/* Container for the sidebar title and close button */
.sidebar-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Style for the close button itself */
.close-selection-btn {
    color: #9ca3af;
}
.close-selection-btn:hover {
    color: #111827;
    background-color: #f3f4f6;
}

/* Style to "darken" the selected events in the calendar */
.event-selected {
    filter: brightness(85%);
}

/* --- MEDIA QUERIES --- */
@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .calendar-main {
        grid-column: span 3 / span 3;
    }
    .sidebar {
        grid-column: span 2 / span 2;
    }
}

@media (max-width: 1279px) {
    .calendar-event,
    .compact-calendar-event {
        max-width: 3rem;
    }
}

@media (max-width: 1023px) {
    .calendar-event,
    .compact-calendar-event {
        max-width: 5rem;
    }
    .calendar-day-cell {
        height: auto;
        min-height: 6rem;
    }
}

@media (max-width: 767px) {
    .hero-content h1 {
        font-size: 1.875rem;
    }
    .hero-subtext {
        font-size: 1.125rem;
    }
    .main-title {
        font-size: 1.5rem;
    }
    .calendar-day-cell {
        min-height: 4rem;
        padding: 0.25rem;
    }
    .calendar-day-header {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    .day-number {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    .calendar-event {
        padding: 0.25rem 0.375rem;
        font-size: 0.7rem;
    }
    .compact-calendar-event {
        padding: 0.2rem 0.3rem;
        font-size: 0.7rem;
    }
    .calendar-event .time {
        font-size: 0.65rem;
        margin-top: 2px;
    }
    .sidebar-content-area {
        max-height: 25rem;
    }
}
