/* Solar System Simulator - TypeScript Project */
/* Portfolio Color Scheme Integration */

:root {
    --bg-primary: #181a20;
    --bg-secondary: #23263a;
    --bg-accent: #353866;
    --accent-color: #ffb347;
    --text-primary: #f5f6fa;
    --text-secondary: #b2becd;
    --space-dark: #0a0a0f;
    --space-blue: #1a1a3e;
    --cosmic-purple: #2d1b69;
    --star-glow: #ffd700;
    --planet-shadow: rgba(0, 0, 0, 0.8);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--space-dark) 0%, var(--bg-primary) 40%, var(--space-blue) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.simulator-header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-accent));
    padding: 30px;
    border-radius: 20px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(255, 179, 71, 0.2);
}

.simulator-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--star-glow);
    font-weight: 700;
}

.simulator-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Main Simulator Layout */
.simulator-layout {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 20px;
    margin-bottom: 30px;
    height: 700px;
    max-height: 700px;
    overflow: hidden;
}

/* Panel Base Styles */
.control-panel,
.info-panel {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-accent));
    border-radius: 15px;
    padding: 25px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    max-height: 700px;
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 179, 71, 0.2);
}

.panel-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.panel-section h3,
.panel-section h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Control Elements */
.control-group {
    margin-bottom: 15px;
}

.control-btn {
    background: linear-gradient(135deg, var(--bg-accent), var(--cosmic-purple));
    color: var(--text-primary);
    border: 2px solid var(--accent-color);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
    min-width: 100px;
}

.control-btn:hover {
    background: linear-gradient(135deg, var(--cosmic-purple), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 179, 71, 0.3);
}

.control-btn.primary {
    background: linear-gradient(135deg, var(--accent-color), #ff8c00);
    color: var(--bg-primary);
}

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

/* Sliders */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-primary);
    outline: none;
    margin: 10px 0;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 179, 71, 0.5);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 179, 71, 0.5);
}

/* Planet Selection */
.planet-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.planet-btn {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    color: var(--text-primary);
    border: 1px solid var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-align: left;
}

.planet-btn:hover,
.planet-btn.active {
    background: linear-gradient(135deg, var(--accent-color), #ff8c00);
    color: var(--bg-primary);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: var(--bg-primary);
    border: 2px solid var(--text-secondary);
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: bold;
    left: 3px;
    top: 0px;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    background: radial-gradient(ellipse at center, var(--space-blue) 0%, var(--space-dark) 70%);
    border-radius: 15px;
    border: 3px solid var(--accent-color);
    overflow: hidden;
    box-shadow: 
        0 0 30px rgba(255, 179, 71, 0.3),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 700px;
    max-height: 700px;
}

#solarCanvas {
    display: block;
    width: 100%;
    height: 700px;
    max-width: 100%;
    max-height: 700px;
    cursor: grab;
    background: transparent;
}

#solarCanvas:active {
    cursor: grabbing;
}

/* Canvas Overlay */
.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.simulation-stats {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(24, 26, 32, 0.9);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: var(--text-secondary);
    margin-right: 15px;
}

.stat-value {
    color: var(--accent-color);
    font-weight: 600;
}

/* Loading Screen */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(24, 26, 32, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-secondary);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.return-section {
    margin-top: 40px;
    text-align: center;
    animation: fadeInUp 0.8s ease 0.3s both;
}
.btn-return {
    background: linear-gradient(135deg, var(--accent-color), #ff8c00);
    color: var(--bg-primary);
    padding: 6px 12px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', Arial, sans-serif;
}
    
.btn-return:hover::after {
    position:absolute;
    background: transparent;
    transform: translateY(-10px);
    width: 50%;
    content: '✨';
    font-size: 0.8rem;
    animation: particle-burst 0.6s ease-out;
}

.btn-return:hover::before {
    position:absolute;
    background: transparent;
    transform: translateY(-10px);
    width: 200%;
    content: '✨';
    font-size: 0.8rem;
    animation: particle-burst 0.6s ease-out;
}

@keyframes particle-burst {
      0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0) scale(0);
      }
      50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px) scale(1.5);
      }
      100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px) scale(0);
      }
    }

/* Ensure scrollbars work properly */
::-webkit-scrollbar {
    width: 10px;
}
    
::-webkit-scrollbar-track {
    background: var(--primary-bg);
}
    
::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}
    
::-webkit-scrollbar-thumb:hover {
    background: #ff8c42;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-screen.hidden {
    display: none;
}

/* Planet Information */
.planet-image-container {
    text-align: center;
    margin: 15px 0;
}

.planet-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), #ff8c00);
    box-shadow: 
        0 0 20px rgba(255, 179, 71, 0.5),
        inset -10px -10px 20px rgba(0, 0, 0, 0.3);
    animation: planetGlow 2s ease-in-out infinite alternate;
}

@keyframes planetGlow {
    0% { box-shadow: 0 0 20px rgba(255, 179, 71, 0.5), inset -10px -10px 20px rgba(0, 0, 0, 0.3); }
    100% { box-shadow: 0 0 30px rgba(255, 179, 71, 0.8), inset -10px -10px 20px rgba(0, 0, 0, 0.3); }
}

/* Planet-specific colors */
.sun-image { background: radial-gradient(circle at 30% 30%, #ffeb3b, #ff9800); }
.mercury-image { background: radial-gradient(circle at 30% 30%, #8c7853, #5d4e37); }
.venus-image { background: radial-gradient(circle at 30% 30%, #ffb347, #ff8c00); }
.earth-image { background: radial-gradient(circle at 30% 30%, #2196f3, #4caf50); }
.mars-image { background: radial-gradient(circle at 30% 30%, #f44336, #d32f2f); }
.jupiter-image { background: radial-gradient(circle at 30% 30%, #ff9800, #795548); }
.saturn-image { background: radial-gradient(circle at 30% 30%, #ffeb3b, #ffc107); }
.uranus-image { background: radial-gradient(circle at 30% 30%, #00bcd4, #0097a7); }
.neptune-image { background: radial-gradient(circle at 30% 30%, #3f51b5, #1a237e); }

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(178, 190, 205, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.info-value {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-align: right;
}

.planet-facts {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.planet-facts p {
    margin-bottom: 10px;
}

.planet-facts p:last-child {
    margin-bottom: 0;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-accent));
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--accent-color);
    margin-top: 20px;
}

.touch-control-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 150px;
}

.touch-control-grid .touch-control:nth-child(1) { grid-column: 2; }
.touch-control-grid .touch-control:nth-child(2) { grid-column: 1; grid-row: 2; }
.touch-control-grid .touch-control:nth-child(3) { grid-column: 2; grid-row: 2; }
.touch-control-grid .touch-control:nth-child(4) { grid-column: 3; grid-row: 2; }
.touch-control-grid .touch-control:nth-child(5) { grid-column: 2; grid-row: 3; }

.mobile-zoom-controls {
    display: flex;
    gap: 10px;
}

.touch-control {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--bg-accent), var(--cosmic-purple));
    color: var(--text-primary);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-control:active {
    background: var(--accent-color);
    color: var(--bg-primary);
    transform: scale(0.95);
}

/* Footer */
.simulator-footer {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-accent));
    border-radius: 15px;
    border: 2px solid var(--accent-color);
    margin-top: 20px;
}

.simulator-footer p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.tech-stack {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tech-tag {
    background: linear-gradient(135deg, var(--accent-color), #ff8c00);
    color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .simulator-layout {
        grid-template-columns: 280px 1fr 280px;
        gap: 15px;
    }
    
    .control-panel,
    .info-panel {
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .simulator-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        height: auto; /* Permite altura dinâmica no mobile */
        max-height: none; /* Remove limitação de altura */
    }
    
    .control-panel,
    .info-panel {
        max-height: none; /* Remove limitação de altura */
        height: auto; /* Altura automática baseada no conteúdo */
        width: 100%;
        box-sizing: border-box;
        overflow-y: visible; /* Remove scroll forçado */
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .simulator-header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .simulator-header {
        padding: 20px;
    }
    
    .simulator-header h1 {
        font-size: 2rem;
    }
    
    .simulator-header p {
        font-size: 1rem;
    }
    
    .control-panel,
    .info-panel {
        padding: 20px;
        min-height: auto; /* Remove altura mínima fixa */
        height: auto; /* Permite altura dinâmica */
        max-height: none; /* Remove limitação de altura */
    }
    
    .canvas-container {
        height: 400px; /* Altura menor no tablet */
        max-height: 400px;
    }
    
    #solarCanvas {
        height: 400px;
        max-height: 400px;
    }
    
    .control-panel .panel-section {
        margin-bottom: 20px;
    }
    
    .control-group {
        margin-bottom: 15px;
    }
    
    .planet-list {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .tech-stack {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .simulator-header h1 {
        font-size: 1.8rem;
    }
    
    .control-panel,
    .info-panel {
        padding: 18px;
        min-height: auto; /* Remove altura mínima fixa */
        height: auto; /* Permite altura dinâmica completa */
        max-height: none; /* Remove limitação de altura */
    }
    
    .canvas-container {
        height: 300px; /* Altura ainda menor no mobile */
        max-height: 300px;
    }
    
    #solarCanvas {
        height: 300px;
        max-height: 300px;
    }
    
    .control-panel .panel-section h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .control-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-width: 90px;
    }
    
    .planet-list {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .planet-btn {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .slider {
        width: 100%;
        margin: 10px 0;
    }
    
    .touch-control {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .touch-control-grid {
        width: 130px;
    }
}