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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

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

.tab-btn.active {
    color: #667eea;
    border-bottom: 3px solid #667eea;
    background: white;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.card h3 {
    color: #444;
    margin: 25px 0 15px;
    font-size: 1.3em;
}

.card h4 {
    color: #555;
    margin: 15px 0 10px;
    font-size: 1.1em;
}

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

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group small {
    display: block;
    color: #888;
    font-size: 0.85em;
    margin-top: 5px;
}

.service-window-section {
    background: #f8faff;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #e0e8ff;
}

.info-text {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f4f8;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.peak-factor-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-size: 1.2em;
}

.hourly-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 15px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.hourly-item span:first-child {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.hourly-item input {
    width: 80px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.radio-group {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    margin: 10px 0;
    color: #555;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}

.target-mode, .agent-mode {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
}

.hidden {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    margin-top: 20px;
}

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

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

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

.results {
    margin-top: 20px;
}

.results-content {
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    line-height: 1.8;
}

.results-content p {
    padding: 8px;
    background: white;
    border-radius: 5px;
    margin: 5px 0;
    border-left: 4px solid #667eea;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 30px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: #f8faff;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s;
}

.upload-area:hover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.upload-area p {
    color: #667eea;
    font-size: 1.1em;
    font-weight: 500;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
    margin: 20px 0;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s;
}

.history-item:hover {
    background: #f5f5f5;
}

.history-item .date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.history-item .forecast {
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.loading {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .container {
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .hourly-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hourly-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 15px;
    }
}