/* 기본 스타일 및 CSS 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: auto;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* 우주 배경 효과 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    opacity: 0.3;
    z-index: -1;
    animation: twinkle 20s infinite linear;
}

@keyframes twinkle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

/* 앱 컨테이너 */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 헤더 */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #64ffda;
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
    margin-bottom: 10px;
}

.app-title i {
    color: #ffd700;
    margin-right: 15px;
}

.app-subtitle {
    font-size: 1.2rem;
    color: #b3b3b3;
    font-weight: 300;
}

.educational-notice {
    background: rgba(255, 193, 7, 0.15);
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 20px;
    text-align: left;
}

.educational-notice p {
    margin: 5px 0;
    color: #fff3cd;
    font-size: 0.95rem;
}

.educational-notice p:first-child {
    color: #ffc107;
    font-weight: 600;
}

.educational-notice i {
    margin-right: 8px;
    color: #ffc107;
}

/* 메인 컨텐츠 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 컨트롤 패널 */
.control-panel {
    background: rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.controls-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
}

.play-btn {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.pause-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.reset-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.control-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0e0e0;
    font-weight: 500;
}

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

.speed-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #64ffda;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
}

#speedDisplay {
    min-width: 40px;
    text-align: center;
    color: #64ffda;
    font-weight: 600;
}

/* 시뮬레이터 컨테이너 */
.simulator-container {
    display: flex;
    flex-wrap: wrap;
}

.simulator-panel {
    flex: 1 1 45%;
    min-width: 400px;
    margin: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.panel-header {
    text-align: center;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 1.4rem;
    color: #64ffda;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.panel-header p {
    color: #b3b3b3;
    font-size: 0.9rem;
}

/* 캔버스 컨테이너 */
.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

canvas {
    border: 2px solid rgba(100, 255, 218, 0.3);
    border-radius: 15px;
    background: radial-gradient(circle at center, #000814 0%, #001d3d 100%);
    cursor: pointer;
    transition: border-color 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

canvas:hover {
    border-color: rgba(100, 255, 218, 0.6);
}

/* 캔버스 오버레이 */
.canvas-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #64ffda;
    pointer-events: none;
}

/* 별 범례 */
.star-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: 0.9rem;
    color: #e0e0e0;
}

.star-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.star-marker.bright {
    background: #ff4444;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

.star-marker.dim {
    background: #888;
}

/* 정보 패널 */
.info-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.info-group {
    margin-bottom: 30px;
}

.info-group:last-child {
    margin-bottom: 0;
}

.info-group h3 {
    font-size: 1.3rem;
    color: #64ffda;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
    color: #b3b3b3;
    font-weight: 500;
}

.info-value {
    color: #ffffff;
    font-weight: 600;
}

.parallax-value {
    color: #ffd700;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

/* 연주시차 정보 */
.parallax-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.star-data {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.star-data h4 {
    color: #ff4444;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.parallax-explanation {
    background: rgba(100, 255, 218, 0.1);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(100, 255, 218, 0.2);
}

.parallax-explanation p {
    margin-bottom: 10px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.parallax-explanation strong {
    color: #64ffda;
}

/* 도움말 패널 */
.help-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.help-panel h3 {
    font-size: 1.3rem;
    color: #64ffda;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.help-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.help-item i {
    font-size: 2rem;
    color: #64ffda;
    margin-bottom: 15px;
}

.help-item p {
    color: #e0e0e0;
    font-size: 0.9rem;
}

.help-item strong {
    color: #ffffff;
}

/* 실제 관측 정보 패널 */
.reality-panel {
    background: rgba(255, 99, 132, 0.1);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(255, 99, 132, 0.2);
    backdrop-filter: blur(10px);
}

.reality-panel h3 {
    font-size: 1.3rem;
    color: #ff6384;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.reality-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 99, 132, 0.2);
    text-align: center;
}

.reality-item i {
    font-size: 2rem;
    color: #ff6384;
    margin-bottom: 15px;
}

.reality-item h4 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.reality-item p {
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.reality-conclusion {
    background: rgba(255, 99, 132, 0.15);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 99, 132, 0.3);
    text-align: center;
}

.reality-conclusion p {
    color: #ffffff;
    font-size: 1rem;
    margin: 0;
}

.reality-conclusion strong {
    color: #ff6384;
}

.reality-conclusion em {
    color: #64ffda;
    font-style: normal;
    font-weight: 600;
}

/* 푸터 */
.app-footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    color: #888;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .simulator-container {
        grid-template-columns: 1fr;
    }
    
    .app-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-group {
        justify-content: center;
    }
    
    .speed-control {
        justify-content: center;
    }
    
    canvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .parallax-info {
        grid-template-columns: 1fr;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
    
    .app-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .control-btn {
        min-width: 80px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .panel-header h2 {
        font-size: 1.2rem;
    }
}
