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

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

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

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

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

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

main {
    padding: 40px;
}

.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.instructions h2 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.instructions ol {
    margin-left: 20px;
}

.instructions li {
    margin: 8px 0;
    line-height: 1.6;
}

.input-area {
    margin-bottom: 30px;
}

.input-area label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

#json-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.3s;
}

#json-input:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

.btn-success {
    background: #28a745;
    color: white;
    font-size: 1.1em;
    padding: 15px 40px;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* Results Section */
.results-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 3px solid #e9ecef;
}

.score-box {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
}

.score-value {
    font-size: 4em;
    font-weight: bold;
    margin-bottom: 10px;
}

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

.score-box.excellent { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.score-box.good { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.score-box.warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.score-box.poor { background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); }

.results-details {
    display: grid;
    gap: 20px;
}

/* Map Container */
.map-container {
    margin: 30px 0;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container h3 {
    color: #1e3c72;
    margin-bottom: 15px;
}

#map {
    border: 2px solid #ddd;
}

.map-legend {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #333;
}

.legend-line {
    width: 30px;
    height: 3px;
    border-radius: 2px;
}

.result-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.result-card h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-card .status-icon {
    font-size: 1.5em;
}

.result-card p {
    margin: 8px 0;
    line-height: 1.6;
}

.result-card.success {
    border-left-color: #28a745;
}

.result-card.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.result-card.error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.crash-list {
    margin-top: 15px;
}

.crash-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    border-left: 3px solid #dc3545;
}

.crash-item strong {
    color: #dc3545;
}

.recommendations {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.recommendations h4 {
    color: #1e3c72;
    margin-bottom: 10px;
}

.recommendations ul {
    margin-left: 20px;
}

.recommendations li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Submit Section */
.submit-section {
    margin-top: 30px;
    padding: 30px;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    text-align: center;
}

.submit-section h3 {
    color: #155724;
    margin-bottom: 10px;
}

.submit-section p {
    margin-bottom: 20px;
}

/* Processing Section */
.processing-section {
    margin-top: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.processing-section h3 {
    color: #1e3c72;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

/* Download Section */
.download-section {
    margin-top: 30px;
    padding: 30px;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    text-align: center;
}

.download-section h3 {
    color: #155724;
    margin-bottom: 10px;
}

.download-buttons {
    margin: 20px 0;
}

.download-buttons h4 {
    margin-bottom: 15px;
}

#download-links {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-link {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.download-link:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Error Section */
.error-section {
    margin-top: 30px;
    padding: 30px;
    background: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 8px;
}

.error-section h3 {
    color: #721c24;
    margin-bottom: 10px;
}

#error-message {
    color: #721c24;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px;
    }

    .score-value {
        font-size: 3em;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
