/* style.css - ORANGE/YELLOW COLOR SCHEME */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    position: relative;
    height: 100vh;
    user-select: none;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a0a00 0%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-width: 400px;
}

.loading-logo {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 30px;
    animation: logoFadeIn 1s ease;
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #FF8C00, #FFD700);
    width: 0%;
    transition: width 0.3s ease;
}

.loading-fact {
    font-size: 0.9em;
    color: #888;
    font-style: italic;
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

.back-button svg {
    width: 16px;
    height: 16px;
}

.sort-control {
    position: fixed;
    top: 75px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    z-index: 1000;
}

.sort-control label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.sort-control select {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-control select:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: #FF8C00;
}

.sort-control select:focus {
    outline: none;
    border-color: #FF8C00;
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.2);
}

.info-panel-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1000;
}

.info-panel-toggle-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.info-panel-toggle-btn:hover {
    background: rgba(255, 140, 0, 0.3);
    border-color: #FF8C00;
    transform: scale(1.1);
}

.info-panel-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.main-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

.header-logo {
    height: 90px;
    width: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 2px 8px rgba(255, 140, 0, 0.3));
}

.scale-indicator {
    position: fixed;
    top: 130px;  /* Changed from 80px to clear the logo + margin + subtitle */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    z-index: 100;
}

.current-scale {
    font-size: 1.2em;
    font-weight: 600;
    color: #FF8C00;
    margin-bottom: 5px;
}

.scale-value {
    font-size: 1.5em;
    font-weight: 300;
    margin-bottom: 15px;
}

.scale-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.scale-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #FF8C00, #FFD700);
    width: 0%;
    transition: width 0.3s ease;
}

.scale-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85em;
    color: #666;
}

.scale-markers span {
    cursor: pointer;
    transition: color 0.3s;
}

.scale-markers span:hover {
    color: #FF8C00;
}

.comparison-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    cursor: grab;
}

.comparison-container:active {
    cursor: grabbing;
}

#scaleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.info-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 500;
}

.info-panel.active {
    right: 0;
}

.info-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.info-close:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: rotate(90deg);
}

.info-panel h2 {
    font-size: 2em;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #FF8C00, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-stats {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.stat-label {
    color: #888;
    font-size: 0.9em;
}

.stat-value {
    color: #FF8C00;
    font-weight: 500;
}

.info-description {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 30px;
}

.fun-facts h3,
.size-comparison h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #FF8C00;
}

.fun-facts ul {
    list-style: none;
    padding: 0;
}

.fun-facts li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: #aaa;
    line-height: 1.5;
}

.fun-facts li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #FFD700;
}

.size-comparison p {
    color: #ccc;
    line-height: 1.6;
}

.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.help-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-content {
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.help-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #888;
    cursor: pointer;
    transition: color 0.3s;
}

.help-close:hover {
    color: #fff;
}

.help-content h2 {
    color: #FF8C00;
    margin-bottom: 20px;
    text-align: center;
}

.help-instructions {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.help-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.help-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    fill: #FF8C00;
}

.help-item strong {
    color: #fff;
    display: block;
    margin-bottom: 5px;
}

.help-item p {
    color: #aaa;
    font-size: 14px;
    margin: 0;
}

.help-ok-btn {
    background: linear-gradient(45deg, #FF8C00, #FFD700);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    display: block;
    margin: 20px auto 0;
    transition: transform 0.3s;
}

.help-ok-btn:hover {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nav-buttons {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.nav-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 140, 0, 0.3);
    border-color: #FF8C00;
    transform: translateY(-2px);
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    z-index: 100;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.control-btn.active {
    background: linear-gradient(45deg, #FF8C00, #FFD700);
    border-color: transparent;
}

.control-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.control-group label {
    font-size: 12px;
    color: #888;
}

.control-group input[type="range"] {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #FF8C00;
    border-radius: 50%;
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.manual-compare-panel {
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 90%;
    max-width: 500px;
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.manual-compare-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.manual-compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.manual-compare-header h3 {
    font-size: 16px;
    color: #FF8C00;
    margin: 0;
}

.manual-compare-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.manual-compare-close:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: rotate(90deg);
}

.manual-compare-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.compare-selection-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compare-selection-group label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.compare-select {
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compare-select:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: #FF8C00;
}

.compare-select:focus {
    outline: none;
    border-color: #FF8C00;
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.2);
}

#applyCompareBtn {
    margin-top: 10px;
    justify-content: center;
}

.scroll-hint {
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: bounce 2s infinite;
    z-index: 100;
    pointer-events: none;
}

.scroll-hint svg {
    width: 24px;
    height: 24px;
    fill: #888;
}

.scroll-hint p {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.scale-instruction {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 140, 0, 0.1);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
    color: #FF8C00;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@@media (max-width: 768px) {
    .scale-indicator {
        width: 95%;
        top: 110px;  /* Adjust for mobile */
        padding: 10px;
    }
}
    
    .sort-control {
        top: 65px;
        left: 10px;
        padding: 10px 12px;
    }
    
    .sort-control select {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .scale-indicator {
        width: 95%;
        top: 70px;
        padding: 10px;
    }
    
    .scale-value {
        font-size: 1.2em;
    }
    
    .nav-buttons {
        bottom: 160px;
        gap: 10px;
    }
    
    .nav-btn {
        width: 45px;
        height: 45px;
    }
    
    .controls {
        flex-direction: column;
        padding: 10px 15px;
        border-radius: 15px;
    }
    
    .manual-compare-panel {
        width: 95%;
        bottom: 160px;
        padding: 15px;
    }
    
    .manual-compare-header h3 {
        font-size: 14px;
    }
    
    .info-panel {
        width: 100%;
        right: -100%;
    }
    
    .scroll-hint {
        bottom: 220px;
    }
    
    .scale-instruction {
        font-size: 0.8em;
        padding: 8px;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: #000;
    }
}

@media (prefers-contrast: high) {
    .control-btn,
    .info-panel {
        border-width: 2px;
    }
}
