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

:root {
    --mercury-color: linear-gradient(135deg, #a9a9a9, #696969);
    --venus-color: linear-gradient(135deg, #ffcc80, #ff9800);
    --earth-color: linear-gradient(135deg, #64b5f6, #1976d2);
    --mars-color: linear-gradient(135deg, #ef9a9a, #c62828);
    --jupiter-color: linear-gradient(135deg, #ffccbc, #ff5722);
    --saturn-color: linear-gradient(135deg, #ffecb3, #ffa000);
    --uranus-color: linear-gradient(135deg, #80deea, #0097a7);
    --neptune-color: linear-gradient(135deg, #5c6bc0, #283593);
    
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent-blue);
    flex-shrink: 0;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, var(--accent-blue), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Main Layout */
.game-area {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 20px;
    margin-bottom: 30px;
    flex-grow: 1;
}

/* Left Panel - Planet Bank */
.planet-bank {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #475569;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.planet-bank h2, .solar-system h2, .learning-panel h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.planet-bank h2 i, .solar-system h2 i, .learning-panel h2 i {
    color: var(--accent-blue);
}

.planets-to-drag {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 15px 0;
}

.planet-draggable {
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: grab;
    font-weight: 500;
    transition: all 0.2s;
    background: var(--bg-card);
    border: 2px solid transparent;
    user-select: none;
}

.planet-draggable:hover {
    border-color: var(--accent-blue);
    transform: translateX(5px);
}

.planet-draggable.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

.planet-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Center Panel - Solar System */
.solar-system {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #475569;
    position: relative;
    min-height: 500px;
    overflow: hidden;
}

.sun {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
    z-index: 1;
}

.sun i {
    color: #fff;
    font-size: 24px;
}

.sun-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fbbf24;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.orbits {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px dashed #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit:nth-child(1) { width: 100px; height: 100px; }
.orbit:nth-child(2) { width: 160px; height: 160px; }
.orbit:nth-child(3) { width: 220px; height: 220px; }
.orbit:nth-child(4) { width: 280px; height: 280px; }
.orbit:nth-child(5) { width: 340px; height: 340px; }
.orbit:nth-child(6) { width: 400px; height: 400px; }
.orbit:nth-child(7) { width: 460px; height: 460px; }
.orbit:nth-child(8) { width: 520px; height: 520px; }

.orbit span {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 0.8rem;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #475569;
    white-space: nowrap;
}

.drop-zones {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.drop-zone {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px dashed var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    pointer-events: auto;
}

.drop-zone.hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #60a5fa;
    transform: scale(1.1);
}

.drop-zone.filled {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    pointer-events: none;
}

.drop-zone.filled::after {
    content: '✓';
    color: var(--accent-green);
    font-size: 20px;
    font-weight: bold;
}

.placed-planets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.placed-planet {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: all 0.3s;
    z-index: 10;
    pointer-events: auto;
    user-select: none;
}

.placed-planet:hover {
    transform: scale(1.1);
    z-index: 20;
}

.placed-planet.correct {
    box-shadow: 0 0 20px var(--accent-green);
    animation: pulse 1s infinite;
}

.placed-planet.incorrect {
    box-shadow: 0 0 20px var(--error-color);
}

/* Right Panel - Learning Center */
.learning-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #475569;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.progress-tracker {
    margin-bottom: 20px;
}

.progress-tracker h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #34d399);
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.planet-fact {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid var(--accent-green);
    min-height: 120px;
}

.planet-fact h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.planet-fact p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.planet-fact em {
    color: #94a3b8;
    font-size: 0.85rem;
}

.score-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
    text-align: center;
}

.score-item {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
}

.score-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.score-value {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: bold;
}

/* Quiz Section */
.quiz-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #475569;
}

.quiz-question {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.quiz-options {
    display: grid;
    gap: 8px;
}

.quiz-option {
    background: var(--bg-card);
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    user-select: none;
}

.quiz-option:hover {
    background: #475569;
    color: var(--text-primary);
}

.quiz-option.correct {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    border-left: 4px solid var(--accent-green);
}

.quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-left: 4px solid #f87171;
}

.quiz-feedback {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    min-height: 40px;
}

/* Buttons */
.btn-check, .btn-reset, .btn-play-again {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    user-select: none;
}

.btn-check {
    background: var(--accent-blue);
    color: white;
}

.btn-check:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

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

.btn-reset {
    background: #64748b;
    color: white;
}

.btn-reset:hover {
    background: #475569;
    transform: translateY(-2px);
}

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

/* Tips Section */
.game-tips {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
}

.game-tips h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-tips ul {
    list-style: none;
    padding-left: 0;
}

.game-tips li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
}

.game-tips li:before {
    content: "•";
    color: var(--accent-blue);
    position: absolute;
    left: 0;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #475569;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.hint {
    color: #fbbf24;
    margin: 10px 0;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.planet-order-hint {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.planet-order-hint span {
    opacity: 0.8;
    transition: opacity 0.2s;
    cursor: default;
}

.planet-order-hint span:hover {
    opacity: 1;
}

/* Keyboard styling */
kbd {
    background: var(--bg-card);
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    display: inline-block;
    min-width: 24px;
    text-align: center;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes timeWarning {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.time-warning {
    animation: timeWarning 1s infinite;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    max-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive */
@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .planet-bank, .learning-panel {
        position: static;
    }
    
    .solar-system {
        min-height: 400px;
    }
    
    .orbit:nth-child(8) { width: 400px; height: 400px; }
    .orbit:nth-child(7) { width: 350px; height: 350px; }
    .orbit:nth-child(6) { width: 300px; height: 300px; }
    .orbit:nth-child(5) { width: 250px; height: 250px; }
    .orbit:nth-child(4) { width: 200px; height: 200px; }
    .orbit:nth-child(3) { width: 150px; height: 150px; }
    .orbit:nth-child(2) { width: 100px; height: 100px; }
    .orbit:nth-child(1) { width: 70px; height: 70px; }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .game-area {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .planet-bank, .solar-system, .learning-panel {
        padding: 15px;
    }
    
    .orbit:nth-child(8) { width: 300px; height: 300px; }
    .orbit:nth-child(7) { width: 260px; height: 260px; }
    .orbit:nth-child(6) { width: 220px; height: 220px; }
    .orbit:nth-child(5) { width: 180px; height: 180px; }
    .orbit:nth-child(4) { width: 140px; height: 140px; }
    .orbit:nth-child(3) { width: 100px; height: 100px; }
    .orbit:nth-child(2) { width: 70px; height: 70px; }
    .orbit:nth-child(1) { width: 50px; height: 50px; }
    
    .drop-zone {
        width: 50px;
        height: 50px;
    }
    
    .placed-planet {
        width: 45px;
        height: 45px;
        font-size: 0.7rem;
    }
    
    .planet-order-hint {
        font-size: 0.75rem;
        gap: 5px;
    }
}