:root {
    --bg-app: #0f1115;
    --bg-card: #181b21;
    --bg-card-hover: #1f232b;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent-primary: #6366f1;
    /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.4);
    --border-color: #2d313a;
    --font-family: 'Outfit', sans-serif;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-family);
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll */
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    /* Keep header fixed size */
}

.app-header h1 {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.controls label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.select-wrapper select {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select-wrapper select:hover {
    border-color: var(--accent-primary);
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    flex: 1;
    /* Take remaining height */
    min-height: 0;
    /* Important for nested scrolling */
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        /* Stack: header/list then calendar */
    }
}

/* Sections */
h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Upcoming List */
.upcoming-section {
    overflow-y: auto;
    /* Allow this to scroll if needed, or stay static */
}

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.holiday-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    position: relative;
    overflow: hidden;
}

.holiday-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background-color: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.holiday-card.nearest {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

.holiday-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.holiday-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.days-counter {
    margin-top: 1rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Calendar */
.calendar-section {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    overflow-y: auto;
    /* Scrollable calendar */
    height: 100%;
    /* Fill the grid cell */
    display: flex;
    flex-direction: column;
    scroll-padding-top: 2rem;
}

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

.calendar-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.dot.holiday {
    background-color: var(--accent-primary);
}

.dot.today {
    background-color: #10b981;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.month {
    /* Month container */
}

.month-name {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.day-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.day {
    font-size: 0.85rem;
    padding: 0.4rem 0;
    color: var(--text-secondary);
    border-radius: 4px;
    position: relative;
}

.day.is-holiday {
    color: var(--text-primary);
    background-color: var(--accent-primary);
    font-weight: 700;
}

.day.is-holiday:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.day.is-today {
    box-shadow: inset 0 0 0 1px #10b981;
}

.day.empty {
    pointer-events: none;
}

.day.highlight-active {
    box-shadow: 0 0 0 2px #fff, 0 0 10px var(--accent-primary);
    z-index: 10;
    transform: scale(1.2);
    transition: all 0.2s ease;
    background-color: var(--accent-primary);
    color: white;
    border-radius: 50%;
}