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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: slideDown 0.6s ease-out;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.6s ease-out;
}

.panel h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 15px;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

input[type="date"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 0.85em;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Error Message */
.error-message {
    margin-top: 15px;
    padding: 12px;
    background: #ffebee;
    color: #c62828;
    border-radius: 8px;
    border-left: 4px solid #c62828;
}

/* Info Box */
.info-box {
    margin-top: 25px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-box h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.info-box ul {
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Results Panel */
.results-panel {
    position: relative;
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    margin-top: 15px;
    color: #666;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

.card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
}

.annual-leave-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.optimal-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.savings-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.card-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 8px;
}

.card-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Output Display */
.output-section {
    margin-top: 20px;
}

.output-section h3 {
    color: #333;
    margin: 20px 0 15px 0;
    font-size: 1.2em;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.output-section:first-child h3 {
    margin-top: 0;
}

.output-section p {
    color: #666;
    margin: 10px 0;
    line-height: 1.6;
}

.output-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.output-section table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.output-section table th {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
    font-weight: 600;
}

.output-section table td {
    padding: 10px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.output-section table tbody tr:hover {
    background: #f5f5f5;
}

.output-section div[style*="background"] {
    border-radius: 8px;
    margin: 15px 0;
}

.output-section strong {
    color: #333;
}

.output-display {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    max-height: 800px;
    overflow-y: auto;
    color: #333;
}

.no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #999;
    font-size: 1.1em;
    text-align: center;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styling */
.output-display::-webkit-scrollbar {
    width: 8px;
}

.output-display::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.output-display::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.output-display::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .panel {
        padding: 20px;
    }
    
    .panel h2 {
        font-size: 1.5em;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
