@import url('https://fonts.googleapis.com/css2?family=Albert+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-color: #f1f5f9;
    /* Light Gray Mist */
    --card-bg: rgba(255, 255, 255, 0.85);
    /* White glass */
    --text-primary: #1e293b;
    /* Dark Slate */
    --text-secondary: #64748b;
    /* Medium Gray */
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;

    --status-office: #047857;
    /* Emerald 700 - Darker green */
    --status-vacation: #d97706;
    /* Amber 600 */
    --status-holiday: #dc2626;
    /* Red 600 - for text/border logic if needed */
    --status-weekend: #4f46e5;
    /* Indigo 600 */

    --amber-50: #fff7ed;
    --amber-100: #fef3c7;
    --amber-600: #d97706;
    --amber-700: #b45309;

    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    /* Light border */
}

/* Navigation Button Hover Effect */
.month-nav a:not(.nav-disabled):hover {
    background-color: var(--background-secondary) !important;
    color: var(--accent-color) !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Albert Sans', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f1f5f9 70%);
}

.container {
    width: 95%;
    max-width: 1200px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

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

.month-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.05);
    /* Slight dark tint on light */
}

.month-nav a:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.current-month {
    font-size: 1.25rem;
    font-weight: 500;
    min-width: 150px;
    text-align: center;
}

/* Calendar Strip */
.calendar-wrapper {
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 2rem;

    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.calendar-wrapper::-webkit-scrollbar {
    height: 8px;
}

.calendar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.calendar-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 20px;
}

.calendar-strip {
    display: flex;
    gap: 2px;
    min-width: min-content;
    /* justify-content: space-between; Optional: if we want to stretch */
}

.day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 55px;

    /* New "Working Day" style - formerly weekend style (Indigo-ish) */
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #4338ca;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
}

.day-cell:hover {
    background: rgba(99, 102, 241, 0.15);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.3);
    border-color: var(--status-vacation);
    z-index: 10;
}

/* Weekends and Holidays - Unified "Non-Working" Look (Slate/Gray) */
.day-cell.weekend {
    background: #cbd5e1;
    /* Slate 300 - was holiday */
    border-color: #94a3b8;
    color: #64748b;
    /* Slate 500 */
}

.day-cell.holiday {
    background: #e2e8f0;
    /* Slate 200 - was weekend */
    border-color: #cbd5e1;
    /* Slate 300 */
    color: #94a3b8;
    /* Slate 400 */
    box-shadow: none;
}

/* Add a small indicator for holidays if needed, e.g. text style */
.day-cell.holiday .day-num {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #64748b;
}

.day-num {
    font-size: 0.9rem;
    font-weight: 600;
}

.day-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Status Indicators */
.day-cell.status-office {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--status-office);
    color: var(--status-office);
}

.day-cell.status-vacation {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--status-vacation);
    color: var(--status-vacation);
}

.day-cell.status-office .day-name,
.day-cell.status-vacation .day-name {
    color: inherit;
}

/* Tooltip for holiday name could go here */

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    padding: 1.5rem;
    border-radius: 16px;
    border: var(--glass-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-value.good {
    color: var(--status-office);
}

.stat-value.bad {
    color: var(--status-holiday);
}

/* Interaction Menu (Custom implementation or simple toggle logic) */
/* For now, we cycle: Empty -> Office -> Vacation -> Empty on click */

footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Nav Disabled State */
.month-nav a.nav-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* Current Day Highlight */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.day-cell.today {
    border-color: var(--accent-color);
    border-width: 2px;
    animation: pulse 2s infinite;
    font-weight: 700;
}



/* Stats Panel Layout - 3 Columns on Desktop */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

@media (min-width: 1024px) {
    .stats-panel {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card Styles including Vacation/Info */
.year-stats-card,
.month-stats-card,
.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.year-stats-card {
    margin-bottom: 0;
}

.month-stats-card {
    margin-bottom: 0;
}

.year-stats-header,
.month-stats-header,
.info-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-stats-grid,
.month-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.year-stat-item,
.month-stat-item {
    display: flex;
    flex-direction: column;
}

.year-stat-label,
.month-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.year-stat-value,
.month-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.year-stat-value.highlight,
.month-stat-value.highlight {
    color: var(--accent-color);
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-container {
    width: 100%;
    height: 12px;
    /* Increased height for visibility */
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-top: auto;
    /* Push to bottom if needed */
}

.progress-bar {
    height: 100%;
    /* Default gradient fallback */
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Override for monthly status */
.progress-bar.monthly-fail {
    background: var(--status-holiday);
    /* Red */
}

.progress-bar.monthly-success {
    background: var(--status-office);
    /* Green */
}

/* Allow inline override for yearly tonal gradient */
.progress-bar[style*="background-color"] {
    background: none;
    /* Reset gradient */
    background-color: inherit;
    /* Applied via style attribute */
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Utility Classes - Must be at the end to override component styles */
.text-success {
    color: var(--status-office);
}

.text-danger {
    color: var(--status-holiday);
}

/* Vacation Period Styling */
.vacation-period-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
}

.vacation-period-item.completed {
    background: rgba(4, 120, 87, 0.05);
    border-left: 4px solid var(--status-office);
}

.vacation-period-item.planned {
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--accent-color);
}

.vacation-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.vacation-status-badge.completed {
    background: var(--status-office);
}

.vacation-status-badge.planned {
    background: var(--accent-color);
}