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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.section {
    background: white;
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.staff-form {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.staff-form input,
.staff-form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.staff-form button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.staff-form button:hover {
    background: #2980b9;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

table tr:hover {
    background: #f5f5f5;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #c0392b;
}

.generate-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 25px;
    transition: background 0.3s;
}

.generate-btn:hover {
    background: #229954;
}

.roster-display {
    margin-top: 20px;
}


.stats-controls {
    margin-bottom: 20px;
}

.reset-btn {
    background: #fd7e14;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.reset-btn:hover {
    background: #e8630a;
}

.roster-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.roster-controls-inline {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group-inline label {
    font-weight: bold;
    color: #495057;
    margin: 0;
    white-space: nowrap;
}

.control-group-inline input[type="date"],
.control-group-inline select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.control-group-inline .generate-btn {
    margin: 0;
    padding: 10px 20px;
}


.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

.control-group input[type="date"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
}

.control-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.generate-btn.monthly {
    background: #007bff;
}

.generate-btn.monthly:hover {
    background: #0056b3;
}

.roster-container {
    margin-top: 15px;
}

.roster-controls-inline {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.plot-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.plot-controls select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.plot-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.2s;
}

.leave-btn {
    background: #dc3545;
    color: white;
}

.leave-btn:hover {
    background: #c82333;
}

.work-btn {
    background: #28a745;
    color: white;
}

.work-btn:hover {
    background: #218838;
}

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

.clear-btn:hover {
    background: #5a6268;
}

.monthly-roster-table.horizontal {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    overflow-x: auto;
}

.monthly-roster-table.horizontal th,
.monthly-roster-table.horizontal td {
    padding: 6px;
    text-align: center;
    border: 1px solid #ddd;
    min-width: 40px;
    white-space: nowrap;
}

.monthly-roster-table.horizontal .role-header {
    background: #343a40;
    color: white;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 60px;
}

.monthly-roster-table.horizontal .role-cell {
    background: #495057;
    color: white;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 9;
    min-width: 60px;
}

.monthly-roster-table.horizontal .date-header {
    background: #343a40;
    color: white;
    font-weight: bold;
    font-size: 11px;
}

.monthly-roster-table.horizontal .day-header {
    background: #495057;
    color: white;
    font-weight: bold;
    font-size: 10px;
}

.monthly-roster-table.horizontal .date-header.weekend,
.monthly-roster-table.horizontal .day-header.weekend {
    background: #6c757d;
}

.monthly-roster-table.horizontal .assignment-cell {
    background: #ffffff;
    font-size: 11px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monthly-roster-table.horizontal .assignment-cell.weekend {
    background: #f8f9fa;
}

.monthly-roster-table.horizontal .assignment-cell.role-empty {
    background: #fff3cd;
    border-color: #ffc107;
    font-weight: bold;
    color: #856404;
}

.monthly-roster-table.horizontal .assignment-cell.role4-empty {
    background: #ffe6e6;
    border-color: #dc3545;
    font-weight: bold;
    color: #dc3545;
}

.leave-indicator {
    color: #dc3545;
    font-weight: bold;
    font-size: 9px;
}

.work-indicator {
    color: #28a745;
    font-weight: bold;
    font-size: 9px;
}

.roster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

.roster-header h3 {
    color: #2c3e50;
    margin: 0;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.download-btn:hover {
    background: #218838;
}

.roster-display h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

#monthlyRosterGrid {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.status-btn {
    background: #e9ecef;
    color: #6c757d;
    border: 1px solid #ced4da;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.2s;
}

.status-btn:hover {
    background: #dee2e6;
}

.status-btn.active {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.status-btn.active:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Styles for individual staff leave and unassigned rows */
.staff-leave-row {
    background: #fff3cd !important;
    color: #856404 !important;
}

.staff-unassigned-row {
    background: #e2e3e5 !important;
    color: #495057 !important;
}

.leave-cell.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.leave-cell.clickable:hover {
    background: #ffeaa7 !important;
    transform: scale(1.05);
}

.unassigned-cell {
    font-size: 16px;
    text-align: center;
}

.unassigned-cell.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.unassigned-cell.clickable:hover {
    background: #e8f4fd !important;
    transform: scale(1.05);
}

/* Highlight rows for better visibility */
.assignment-cell.leave-cell {
    font-size: 18px;
    text-align: center;
    border: 1px solid #ffc107;
}

.assignment-cell.unassigned-cell {
    font-size: 16px;
    text-align: center;
    border: 1px solid #6c757d;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .staff-form {
        flex-direction: column;
    }
    
    .staff-form input,
    .staff-form select,
    .staff-form button {
        width: 100%;
    }
    
    
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .control-group input[type="date"] {
        width: 100%;
    }
    
    .roster-controls-inline {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .control-group-inline {
        flex-direction: column;
        gap: 5px;
        align-items: stretch;
    }
    
    .control-group-inline input[type="date"],
    .control-group-inline select,
    .control-group-inline .generate-btn {
        width: 100%;
        min-width: unset;
    }
    
    .roster-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    
    .monthly-roster-table.horizontal {
        font-size: 10px;
    }
    
    .monthly-roster-table.horizontal th,
    .monthly-roster-table.horizontal td {
        padding: 4px;
        min-width: 35px;
    }
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 4px solid #3498db;
}

.footer-content p {
    margin: 5px 0;
    font-size: 16px;
}

.footer-content strong {
    font-weight: 600;
    color: #ffd700;
}

.footer-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-style: italic;
}

@media (max-width: 768px) {
    .footer {
        padding: 20px 15px;
    }
    
    .footer-content p {
        font-size: 14px;
    }
    
    .footer-subtitle {
        font-size: 12px;
    }
}