/* ============================================
   Solar System 3D Simulation - Styles
   ============================================ */

/* CSS Reset & Base Styles */

.roboto-regular {
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Roboto;
    font-weight: 400;
    background-color: #000000;
    color: #ffffff;
}

/* App Container */
#app-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Canvas Container - Full Viewport */
#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Loading Indicator */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    color: #ffffff;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    font-size: 16px;
    margin-top: 10px;
}

/* UI Controls - Tabbed Panel System */
.ui-controls {
    position: relative;
    z-index: 10;
}

/* Logo Container */
.logo-container {
    z-index: 200;
    position: fixed;
    top: 35px;
    left: 35px;
}

.logo-container.hidden {
    visibility: hidden;
}

.logo-solar-system {
    width: 200px;
}

/* Mobile Toggle Button */
.tabbed-panel-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(100, 150, 255, 0.9);
    border: 2px solid rgba(100, 150, 255, 1);
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    display: none; /* Hidden on desktop */
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease;
    align-items: center;
    justify-content: center;
    touch-action: manipulation; /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.tabbed-panel-toggle:hover {
    background: rgba(100, 150, 255, 1);
    transform: scale(1.1);
}

.tabbed-panel-toggle:active {
    transform: scale(0.95);
}

.tabbed-panel-toggle.active {
    background: rgba(100, 150, 255, 1);
}

.tabbed-panel-toggle .toggle-icon {
    display: block;
    transition: transform 0.5s ease;
    user-select: none;
}

/* Tabbed Panel Container */
.tabbed-panel {
    position: fixed;
    right: 0px;
    top: 0px;
    bottom: 0px;
    background: rgba(20, 20, 30, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    z-index: 99;
    display: flex;
    margin: 10px;
    box-sizing: border-box;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform; /* Optimize for animations */
}

.tabbed-panel.hidden {
    transform: translateX(100%);
}

/* Tab Navigation */
.tabbed-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.tab-navigation {
    display: flex;
    gap: 8px;
    flex: 1;
}

.tab-button {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #cccccc;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.5s ease;
    position: relative;
    min-height: 44px;
}

.tab-button:hover:not(.disabled) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
    color: #a0c0ff;
    border-bottom-color: #6496ff;
}

.tab-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Tab Content Container */
.tabbed-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    visibility: hidden;
}

.tab-content.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Scrollbar styling */
.tabbed-panel-content::-webkit-scrollbar {
    width: 8px;
}

.tabbed-panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.tabbed-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.tabbed-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Control Panel (now inside Controls tab) */
.control-panel {
    /* Styles moved to tab content, keeping for backward compatibility if needed */
}

.control-section {
    margin-bottom: 24px;
}

.control-section:last-child {
    margin-bottom: 0;
}

/* Date/Time Display */
.date-time-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: center;
}

.date-time-value {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.timezone {
    font-size: 18px;
    font-weight: 600;
    color: #cccccc;
}

.pause-indicator {
    color: #cccccc;
    margin-left: 8px;
}

/* Mobile adjustments for date display */
@media (max-width: 768px) {
    .date-time-value,
    .timezone {
        font-size: 16px;
    }
}

/* Date Picker */
.date-picker-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.date-picker-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.date-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-family: Roboto;
    outline: none;
    transition: all 0.5s;
}

.date-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.date-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(100, 150, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(100, 150, 255, 0.2);
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.5s;
}

.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.update-time-btn {
    padding: 10px 16px;
    background: rgba(100, 150, 255, 0.2);
    border: 1px solid rgba(100, 150, 255, 0.4);
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.5s;
    white-space: nowrap;
}

.update-time-btn:hover {
    background: rgba(100, 150, 255, 0.3);
    border-color: rgba(100, 150, 255, 0.6);
    transform: translateY(-1px);
}

.update-time-btn:active {
    transform: translateY(0);
}

.update-time-btn-active {
    background: rgba(100, 150, 255, 0.4);
    border-color: rgba(100, 150, 255, 0.8);
    box-shadow: 0 0 8px rgba(100, 150, 255, 0.4);
}

.date-error {
    padding: 8px 12px;
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    color: #ffaaaa;
    font-size: 12px;
    line-height: 1.4;
}

.animate-to-date-btn {
    padding: 10px 16px;
    background: rgba(150, 100, 255, 0.2);
    border: 1px solid rgba(150, 100, 255, 0.4);
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.5s;
    white-space: nowrap;
}

.animate-to-date-btn:hover:not(:disabled) {
    background: rgba(150, 100, 255, 0.3);
    border-color: rgba(150, 100, 255, 0.6);
    transform: translateY(-1px);
}

.animate-to-date-btn:active:not(:disabled) {
    transform: translateY(0);
}

.date-animation-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.date-animation-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(150, 100, 255, 0.8), rgba(100, 150, 255, 0.8));
    border-radius: 2px;
    transition: width 0.1s linear;
    width: 0%;
}

/* Disabled state for buttons */
.control-btn.disabled,
.speed-btn.disabled,
.update-time-btn.disabled,
.animate-to-date-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.control-btn.disabled:hover,
.speed-btn.disabled:hover,
.update-time-btn.disabled:hover,
.animate-to-date-btn.disabled:hover {
    transform: none;
    background: inherit;
    border-color: inherit;
}

/* Mobile adjustments for date picker */
@media (max-width: 768px) {
    .date-picker-input-group {
        flex-direction: column;
    }
    
    .update-time-btn,
    .animate-to-date-btn {
        width: 100%;
    }
}

/* Panel content – tag-based typography (all tabs) */
.tabbed-panel-content h2 {
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0c0ff;
    margin-bottom: 16px;
}

.tabbed-panel-content h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0a0ff;
    margin: 0;
}

.tabbed-panel-content .panel-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.tabbed-panel-content .panel-section-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    flex-shrink: 0;
}

.tabbed-panel-content p {
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
}

.tabbed-panel-content ul {
    list-style: none;
    padding: 0;
}

.tabbed-panel-content li {
    padding: 4px 0;
    padding-left: 24px;
    position: relative;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tabbed-panel-content li:last-child {
    border-bottom: none;
}

.tabbed-panel-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6496ff;
    font-size: 20px;
    line-height: 1;
}

.tabbed-panel-content dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
}

.tabbed-panel-content dt {
    font-weight: 600;
    color: #cccccc;
    font-size: 14px;
}

.tabbed-panel-content dd {
    color: #e0e0e0;
    font-size: 14px;
    margin: 0;
}

.tabbed-panel-content dd.gravity-comparison {
    grid-column: 1 / -1;
    margin-top: 4px;
    font-style: italic;
}

.tabbed-panel-content label {
    font-size: 12px;
    color: #cccccc;
    font-weight: 500;
}

/* Speed Controls */
.speed-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.play-pause-btn {
    width: 100%;
    padding: 12px;
    background: rgba(100, 150, 255, 0.2);
    border: 1px solid rgba(100, 150, 255, 0.4);
    border-radius: 8px;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.5s;
}

.play-pause-btn:hover {
    background: rgba(100, 150, 255, 0.3);
    border-color: rgba(100, 150, 255, 0.6);
}

.play-pause-btn .icon {
    display: inline-block;
}

.speed-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.speed-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.5s;
}

.speed-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.speed-btn.active {
    background: rgba(100, 150, 255, 0.3);
    border-color: rgba(100, 150, 255, 0.6);
    color: #a0c0ff;
}

.speed-display {
    font-size: 12px;
    color: #cccccc;
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

#current-speed {
    color: #a0c0ff;
    font-weight: 600;
}

/* Scale Controls */
.scale-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scale-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scale-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scale-control input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.scale-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #6496ff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.5s;
}

.scale-control input[type="range"]::-webkit-slider-thumb:hover {
    background: #7aa5ff;
    transform: scale(1.1);
}

.scale-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #6496ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.5s;
}

.scale-control input[type="range"]::-moz-range-thumb:hover {
    background: #7aa5ff;
    transform: scale(1.1);
}

/* Checkbox styling for scale controls */
.scale-control .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: left;
    cursor: pointer;
    user-select: none;
}

.scale-control .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6496ff;
    flex-shrink: 0;
}

.scale-control .checkbox-label span {
    font-size: 12px;
    color: #cccccc;
}

#base-size-scale-value,
#size-equalization-value {
    color: #a0c0ff;
    font-weight: 600;
    font-size: 13px;
}

/* Mode Indicator for Equalization Slider */
.scale-mode-indicator {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999999;
    margin-top: 4px;
}


.visual-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.visual-control .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: left;
    cursor: pointer;
    user-select: none;
}

.mode-label {
    font-weight: 400;
    transition: all 0.5s;
}

.mode-label.left {
    /* Proportional label - active at 0% */
}

.mode-label.right {
    /* Equalized label - active at 100% */
}

/* Selection Display */
.selection-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#selected-planet-name {
    color: #a0c0ff;
    font-weight: 600;
}

#deselect-btn {
    padding: 8px 16px;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.4);
    border-radius: 6px;
    color: #ffaaaa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.5s;
}

#deselect-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.6);
}

.control-btn {
    cursor: pointer;
    transition: all 0.5s;
}

/* Information Tab – layout only (typography via .tabbed-panel-content tags) */
.information-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.information-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999999;
}

.information-image-container {
    width: 100%;
    margin-bottom: 20px;
}

.information-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.information-description {
    margin-bottom: 20px;
}

.information-facts,
.information-properties {
    margin-bottom: 20px;
}

/* Scientific Tab – layout only */
.scientific-content {
    padding: 20px 0;
}

.scientific-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.scientific-placeholder ul {
    text-align: left;
    max-width: 300px;
    margin: 24px auto 0;
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    .tabbed-panel {
        width: 400px;

    }
}

/* Responsive Design - Mobile */
@media (max-width: 1023px) {
    .tabbed-panel {
       margin: 10px;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
       
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }

    .tabbed-panel.hidden {
        transform: translateY(100%);
    }

    .tabbed-panel:not(.hidden) {
        transform: translateY(0);
    }

    .tabbed-panel-toggle {
        display: flex;
    }

    .tabbed-panel-header {
        padding: 12px 16px;
        touch-action: none; /* Allow dragging from header */
    }

    .tab-button {
        padding: 12px 14px;
        min-height: 48px;
        font-size: 14px;
        touch-action: manipulation; /* Prevent double-tap zoom */
    }

    .tabbed-panel-content {
        padding: 16px;
        /* Allow scrolling in content area */
        touch-action: pan-y;
    }

    .speed-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .speed-btn {
        padding: 10px 14px;
        min-height: 48px;
        font-size: 14px;
        touch-action: manipulation;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .tabbed-panel {
        height: 100vh;
        top: 0;
        bottom: auto;
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .tabbed-panel.hidden {
        transform: translateX(100%);
    }

    .tabbed-panel:not(.hidden) {
        transform: translateX(0);
    }

    /* Show toggle only in portrait mode */
    @media (orientation: portrait) {
        .tabbed-panel {
            /* Portrait: use bottom sheet layout */
            margin: 10px;
            top: 0;
            bottom: 0;
            right: 0;
            left: 0;
            width: 100%;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            border-left: none;
            transform: translateY(100%);
        }

        .tabbed-panel.hidden {
            transform: translateY(100%);
        }

        .tabbed-panel:not(.hidden) {
            transform: translateY(0);
        }

        .tabbed-panel-toggle {
            display: flex;
        }
    }

    @media (orientation: landscape) {
        .tabbed-panel {
            /* Landscape: use side panel layout */
            width: 400px;
            top: 0;
            bottom: 0;
            border-top: none;
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 0;
            transform: translateX(0);
        }

        .tabbed-panel.hidden {
            transform: translateX(100%);
        }

        .tabbed-panel:not(.hidden) {
            transform: translateX(0);
        }

        .tabbed-panel-toggle {
            display: none;
        }
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

p {
    line-height: 1.6;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Responsive Design (for future mobile support) */
@media (max-width: 768px) {
    .loading p {
        font-size: 14px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
}

