/* =============== GLOBAL STYLES =============== */

:root {
    --bg-dark: #070913;
    --bg-mid: #10142b;
    --bg-light: #1a2044;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-light) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.no-scroll {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

/* ==========================================
   ANIMATED LOGO
   ========================================== */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-blue) 0%, #ffffff 50%, var(--accent-cyan) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientFlow 4s linear infinite;
    letter-spacing: 1px;
}

@keyframes gradientFlow {
    0% { background-position: 0% }
    100% { background-position: 200% }
}

/* ==========================================
   STARS BACKGROUND
   ========================================== */
.stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
    box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.3);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ==========================================
   HEADER & NAV
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(7, 9, 19, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-toggle {
    display: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    border-color: rgba(79, 172, 254, 0.3);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.15);
}

/* ==========================================
   MAIN LAYOUT
   ========================================== */
.main-container {
    position: relative;
    z-index: 10;
    flex-grow: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 8rem 2rem 2rem;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.content-wrapper.single-column {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin: 0 auto;
}

.title, .section-title { 
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(45deg, #e2e8f0, var(--accent-blue), var(--accent-purple));
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease infinite;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-title {
    text-align: center;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.description, .section-subtitle { 
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.6;
}

.section-subtitle {
    margin: 0 auto 3rem;
    text-align: center;
}

.description {
    margin-bottom: 2rem;
}

/* ==========================================
   FORM (INDEX)
   ========================================== */
.form-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    max-width: 600px;
    box-shadow: var(--glass-shadow);
    margin-top: 2rem;
}

.form-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group select {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.input-group select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.input-group select option {
    background-color: var(--bg-mid);
    color: #fff;
}

.calculate-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(79, 172, 254, 0.4);
    filter: brightness(1.1);
}

.calculate-btn:active {
    transform: translateY(1px);
}

/* ==========================================
   RESULTS MODAL
   ========================================== */
.results-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 9, 19, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fade-in 0.4s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.results-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--glass-shadow);
}

.results-content::-webkit-scrollbar {
    width: 8px;
}
.results-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
.results-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.results-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.planet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.planet-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.8rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    animation: slide-up 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slide-up {
    to { opacity: 1; transform: translateY(0); }
}

.planet-card:nth-child(1) { animation-delay: 0.1s; }
.planet-card:nth-child(2) { animation-delay: 0.15s; }
.planet-card:nth-child(3) { animation-delay: 0.2s; }
.planet-card:nth-child(4) { animation-delay: 0.25s; }
.planet-card:nth-child(5) { animation-delay: 0.3s; }
.planet-card:nth-child(6) { animation-delay: 0.35s; }
.planet-card:nth-child(7) { animation-delay: 0.4s; }
.planet-card:nth-child(8) { animation-delay: 0.45s; }

.planet-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.planet-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent-blue);
    letter-spacing: 1px;
}

.planet-age {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #fff;
}

.planet-details {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.results-footer-text {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.birthday-message {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.results-footer-text p {
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   ASTRONAUT ANIMATION (INDEX)
   ========================================== */
.astronaut-container {
    position: relative;
    animation: slide-in-right 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.astronaut {
    width: 320px;
    height: 320px;
    background: url(assets/ast.png) no-repeat center/contain;
    animation: astronaut-float 6s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(79, 172, 254, 0.3));
}

@keyframes astronaut-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    background: rgba(7, 9, 19, 0.9);
    backdrop-filter: blur(10px);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-section h3 {
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer-section p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .title, .section-title {
        font-size: 2.5rem;
    }

    .description {
        margin: 0 auto 2rem;
    }
    
    .input-group label {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .main-container {
        padding: 6rem 1rem 1.5rem;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }

    .nav-toggle span {
        width: 100%;
        height: 3px;
        background: white;
        border-radius: 3px;
        transition: var(--transition);
        transform-origin: left center;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        width: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        max-width: 320px;
        background: rgba(7, 9, 19, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;
        padding-top: 100px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid var(--glass-border);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.8rem 2rem;
        width: calc(100% - 4rem);
        margin: 0 auto;
        text-align: center;
        border-radius: 12px;
        border: 1px solid transparent;
    }

    .form-group {
        flex-direction: column;
        gap: 1.5rem;
    }

    .planet-grid {
        grid-template-columns: 1fr;
    }

    .results-content {
        padding: 2.5rem 1.2rem;
    }

    .results-title {
        font-size: 1.6rem;
        margin-top: 1.5rem;
        padding-right: 2.5rem;
        padding-left: 1rem;
    }

    .close-btn {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    
    .astronaut {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .title, .section-title {
        font-size: 2rem;
    }

    .form-container {
        padding: 1.5rem;
    }
    
    .astronaut {
        width: 200px;
        height: 200px;
    }
}
