* {
    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;
    color: #333;
}

header {
    background: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #764ba2;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

nav {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    margin-bottom: 2rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 1rem 2rem;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    background: #f5f5f5;
}

nav a.active {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    display: none;
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.control-panel {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.park-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.checkbox-label:hover {
    border-color: #764ba2;
    background: #f8f6ff;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

input[type="number"], select {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: #764ba2;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #d63447 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 52, 71, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff30;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

#status-message {
    text-align: center;
    color: #666;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.file-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.file-name {
    font-size: 0.9rem;
    color: #555;
    word-break: break-all;
}

.download-btn {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #218838;
}

.heatmaps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.heatmap-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.heatmap-item h4 {
    background: #f8f9fa;
    padding: 1rem;
    margin: 0;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.heatmap-item img {
    width: 100%;
    height: auto;
    display: block;
}

.heatmap-canvas {
    width: 100%;
    min-height: 400px;
}

#live-heatmap-container {
    margin-top: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: white;
    margin-top: 4rem;
}

/* Configuration styles */
.config-actions {
    margin: 1rem 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.attractions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-top: 1rem;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    background: #f8f9fa;
}

.attraction-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.attraction-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.attraction-item input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.attraction-item.ignored {
    background: #ffe6e6;
    border-color: #ff6b6b;
}

.config-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.config-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.config-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Live view styles */
#live-status {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
}

#live-status p {
    margin: 0 0 0.5rem 0;
    color: #0066cc;
    font-weight: 500;
}

#live-status small {
    color: #666;
    font-size: 0.85rem;
}

.form-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .park-selector {
        grid-template-columns: 1fr;
    }
    
    .heatmaps-grid {
        grid-template-columns: 1fr;
    }
    
    nav a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}