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

body {
    font-family: Arial, sans-serif;
    background: url('assets/worldmodelbg3.jpg') center/cover no-repeat fixed;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(128, 128, 128, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    flex-wrap: nowrap;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    min-height: 80px;
}

.header-left {
    flex: 0 0 auto;
    min-width: 80px;
}

.header-center {
    flex: 0 0 auto;
    text-align: center;
    min-width: 180px;
}

.header-center h1 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
}

.header-center p {
    font-size: 10px;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
}

.header-right {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 20px;
    min-width: 0;
    justify-content: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
    max-width: 200px;
}

.control-group label {
    font-size: 10px;
    color: #FAFA00;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #FAFA00;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #FAFA00;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.control-group span {
    font-size: 10px;
    color: #FAFA00;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 40px;
    margin: 0 auto;
}

.nav-btn {
    padding: 6px 12px;
    background: #FAFA00;
    border: 1px solid #e6e600;
    color: #000;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    white-space: nowrap;
    height: fit-content;
    align-self: center;
    font-weight: bold;
}

.nav-btn:hover {
    background: #e6e600;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.main-content {
    padding: 20px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-container {
    width: 100%;
    max-width: 1000px;
    background: rgba(128, 128, 128, 0.85);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

#worldChart {
    width: 100% !important;
    height: 400px !important;
    max-height: 60vh;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.intro-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/worldmodelbg3.jpg') center/cover no-repeat;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.intro-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(128, 128, 128, 0.4);
    z-index: -1;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(128, 128, 128, 0.8);
    border-radius: 10px;
    padding: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
}

.intro-content h2 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 30px;
    color: #FAFA00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.intro-text p {
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: justify;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.intro-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.intro-footer p {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.start-btn {
    padding: 12px 30px;
    background: #FAFA00;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.start-btn:hover {
    background: #e6e600;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.hidden {
    display: none;
}

/* iOS Safari specific fixes */
@supports (-webkit-appearance: none) {
    .control-group input[type="range"] {
        -webkit-appearance: none;
        appearance: none;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
        outline: none;
        cursor: pointer;
    }

    .control-group input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 14px;
        height: 14px;
        background: #FAFA00;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        border: none;
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .header {
        padding: 8px 15px;
        gap: 10px;
    }
    
    .header-center h1 {
        font-size: 18px;
    }
    
    .header-center p {
        font-size: 9px;
    }
    
    .control-group {
        min-width: 140px;
        max-width: 160px;
    }
    
    .control-group label {
        font-size: 9px;
    }
    
    .control-group span {
        font-size: 9px;
    }
}

/* Mobile Responsive - Still one line but smaller */
@media (max-width: 768px) {
    .header {
        padding: 6px 10px;
        gap: 8px;
        min-height: 70px;
    }
    
    .header-left {
        min-width: 60px;
    }
    
    .header-center {
        min-width: 140px;
    }
    
    .header-center h1 {
        font-size: 16px;
    }
    
    .header-center p {
        font-size: 8px;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .control-group {
        min-width: 100px;
        max-width: 120px;
        gap: 2px;
    }
    
    .control-group label {
        font-size: 8px;
    }
    
    .control-group span {
        font-size: 8px;
        padding: 1px 3px;
        min-width: 30px;
    }
    
    .nav-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .main-content {
        height: calc(100vh - 90px);
        padding: 10px;
    }
    
    .chart-container {
        padding: 15px;
        background: rgba(128, 128, 128, 0.9);
    }
    
    .legend {
        gap: 10px;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    .intro-content {
        padding: 20px;
        margin: 10px;
        background: rgba(128, 128, 128, 0.9);
    }
    
    .intro-content h2 {
        font-size: 24px;
    }
}

/* Very small screens - Stack vertically only when absolutely necessary */
@media (max-width: 480px) {
    .header {
        flex-wrap: wrap;
        justify-content: center;
        min-height: auto;
    }
    
    .header-left, .header-center {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
    
    .control-group {
        min-width: 120px;
        max-width: 150px;
    }
    
    .control-group label {
        font-size: 9px;
    }
    
    .main-content {
        height: calc(100vh - 120px);
    }
    
    .chart-container {
        background: rgba(128, 128, 128, 0.95);
    }
}