/* Calendar styling with ISO 8601 (Monday start) and enhanced UI */

:root {
    --holiday-color: #e7cdbb;
    --today-color: #5778e6;
    --weekend-color: #f9f9f9;
    --odd-week-bg: #ffffff;
    --even-week-bg: #f9f9f9;
    --border-color: #f0f0f0;
}

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

/* Navbar */
.nav-top {
    background: #333333 !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    font-family: 'Oswald', Arial, Helvetica, sans-serif;
    color: #ebebeb !important;
}

.navbar-toggler {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.navbar-toggler:focus {
    outline: none !important;
    box-shadow: none !important;
}

.navbar-dark .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* Sidebar Menu (right side) */
.sidebar {
    position: fixed;
    right: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background-color: #333;
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: -2px 0 5px rgba(0,0,0,0.3);
}

.sidebar.open {
    right: 0;
}

.sidebar a {
    display: block;
    padding: 16px 20px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #444;
    transition: background-color 0.2s ease;
}

.sidebar a:hover {
    background-color: #444;
}

.sidebar .close-btn {
    font-size: 36px;
    text-align: right;
    padding: 10px 20px;
    border-bottom: 1px solid #444;
}

.sidebar .close-btn:hover {
    background-color: #444;
}

body {
    background: #3d3d3d;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
}

.container-fluid {
    max-width: 1400px;
}

h1 {
    color: #fff;
    margin-bottom: 1.5rem;
}

.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    background: white;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-select {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-select:hover {
    border-color: #667eea;
}

.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 2rem;
}

.month-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: visible;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.month-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.month-header {
    padding: 16px;
    color: white;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.month-color-1 { background: #FF6B6B; }
.month-color-2 { background: #5d9486; }
.month-color-3 { background: #45B7D1; }
.month-color-4 { background: #FFA07A; }
.month-color-5 { background: #3687b6; }
.month-color-6 { background: #c3c483; }
.month-color-7 { background: #5eaf9b; }
.month-color-8 { background: #BB8FCE; }
.month-color-9 { background: #F8B88B; }
.month-color-10 { background: #6095b4; }
.month-color-11 { background: #F1948A; }
.month-color-12 { background: #aa8293; }

.month-header h3 {
    margin: 0;
    font-size: 18px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    flex-grow: 0;
}

.calendar-table tr {
    display: flex;
    min-height: 40px;
}

.day-headers {
    background: #f5f5f5;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.calendar-table th,
.calendar-table td {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
    font-size: 13px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.calendar-table th:last-child,
.calendar-table td:last-child {
    border-right: none;
}

.day-headers th {
    padding: 10px 4px;
    font-size: 12px;
}

.week-number {
    background: #fafafa;
    font-weight: 600;
    color: #999;
    font-size: 11px;
    flex: 0.75;
    border-right: 2px solid #e0e0e0 !important;
}

.week-row.current-week .week-number {
    background: #bcbed3 !important;
    color: #333;
}

.week-row {
    flex-grow: 1;
}

.week-row.odd-week {
    background: var(--odd-week-bg);
}

.week-row.even-week {
    background: var(--even-week-bg);
}

.week-row.current-week {
    background: #bcbed3 !important;
}

.day-cell {
    padding: 12px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-cell.non-working {
    color: #d32f2f;
    font-weight: 600;
    background: inherit;
}

.day-cell:not(.empty-cell):hover {
    background: #c2c2c2;
}

.empty-cell {
    background: #fafafa;
    color: #ccc;
    cursor: default;
}

.day-cell.today {
    border: 2px solid #555555;
}

.day-cell.holiday {
    background: var(--holiday-color);
    color: red;
    font-weight: 700;
    position: relative;
}

.day-cell.holiday::before {
    content: attr(data-holiday);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.day-cell.holiday::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    margin-bottom: -2px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.day-cell.holiday:hover::before,
.day-cell.holiday:hover::after {
    opacity: 1;
}

.holiday-list {
    padding: 12px 16px;
    background: #f0f8ff;
    border-top: none;
    font-size: 12px;
    color: #333;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.holiday-list strong {
    display: block;
    margin-bottom: 8px;
    color: #667eea;
    font-weight: 700;
}

.holiday-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.holiday-list ul.empty-holidays {
    flex-grow: 1;
}

.holiday-list li {
    padding: 4px 0;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

.holiday-list li:last-child {
    border-bottom: none;
}

.holiday-list li.no-holidays {
    color: #555;
    font-style: italic;
    text-align: left;
    padding: 4px 0;
    border-bottom: none;
}

.holiday-date {
    font-weight: 600;
    color: #FFD700;
    margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .calendar-table th,
    .calendar-table td {
        padding: 6px 2px;
        font-size: 11px;
    }
    
    .month-header h3 {
        font-size: 16px;
    }
    
    .day-cell {
        padding: 8px 2px;
    }
    
    .holiday-list {
        font-size: 11px;
    }
    
    .calendar-table tr {
        min-height: 35px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }
    
    .calendar-grid {
        gap: 10px;
    }
    
    .calendar-table th,
    .calendar-table td {
        padding: 4px 1px;
        font-size: 9px;
    }
    
    .day-cell {
        padding: 6px 1px;
    }
    
    .week-number {
        font-size: 9px;
    }
    
    .month-header h3 {
        font-size: 14px;
    }
    
    .calendar-table tr {
        min-height: 30px;
    }
}

