/* style_new.css */
:root {
    --color-1: #4CAF50;
    --color-2: #FFEB3B;
    --color-3: #FF9800;
    --color-4: #F44336;
    --base-week-width: 25px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    font-size: 14px;
}

.container {
    max-width: 100%;
    overflow-x: auto;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.control-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.employee-selector, .date-inputs {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.employee-selector select, .date-inputs input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    height: fit-content;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

.vacation-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.vacation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 5px;
}

.btn-edit, .btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: 5px;
    padding: 5px;
}

.btn-edit:hover, .btn-delete:hover {
    opacity: 0.7;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 10px;
}

.vacation-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
    min-width: 800px;
    border: 1px solid #ddd;
}

.vacation-table th, 
.vacation-table td {
    border: 1px solid #e0e0e0;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.employee-header {
    background-color: #2E7D32;
    color: white;
    font-weight: bold;
    text-align: left;
    padding-left: 10px;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    position: sticky;
    left: 0;
    z-index: 10;
    height: 40px;
}

.month-header {
    background-color: #5F9EA0;
    color: #333;
    font-weight: bold;
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 10;
    height: 40px;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    border-right: 2px dashed #666;
}

.month-span-cell {
    background-color: #5F9EA0;
    color: #ffffff;
    font-size: 14px;
    height: 40px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 2px solid #2E7D32;
}

.week-cell {
    background-color: transparent;
    height: 30px;
    position: relative;
    padding: 0;
}

.month-break-cell {
    background-color: transparent;
    height: 30px;
    position: relative;
    padding: 0;
    border-right: 1px solid #e0e0e0;
}

.week-fill {
    height: 100%;
    transition: all 0.3s ease;
    background-color: transparent;
    position: absolute;
    top: 0;
    left: 0;
}

.color-1 { background-color: var(--color-1); opacity: 0.3; }
.color-2 { background-color: var(--color-2); opacity: 0.5; }
.color-3 { background-color: var(--color-3); opacity: 0.7; }
.color-4 { background-color: var(--color-4); opacity: 0.9; }

.employee-name {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: left;
    padding-left: 10px;
    position: sticky;
    left: 0;
    z-index: 5;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    height: 30px;
    border-right: 2px dashed #666;
}

.vacation-table thead .month-span-cell {
    border-bottom: 2px solid #2E7D32;
}

.week-cell:hover .week-fill:not([style*="width: 0%"]) {
    opacity: 0.8;
}

.month-break-cell:hover .week-fill:not([style*="width: 0%"]) {
    opacity: 0.8;
}

/* Скрываем цифры в ячейках */
.month-break-cell {
    color: transparent;
    font-size: 0;
}

.month-break-cell:hover {
    color: transparent;
}

@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .employee-selector, .date-inputs {
        width: 100%;
    }
    
    .legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .week-cell, .month-break-cell {
        min-width: 15px !important;
    }
    
    .employee-header,
    .employee-name,
    .month-header {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
    }

    .vacation-table tbody tr:nth-child(even) {
        background-color: #fafafa;
    }

    .vacation-table tbody tr:nth-child(odd) {
        background-color: #ffffff;
    }

    .employee-header {
        background-color: #e9ecef;
        color: #333;
        border-right: 2px dashed #666;
    }
}