@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #000;
    --secondary-color: #fff;
    --text-color: #d2d2d2;
    --hover-color: #c9c9c9;
    --menu-bg: rgba(0, 0, 0, 0.8);
    --animation-duration: 0.5s;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
}

ul {
    list-style: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color); /* สีดำแบบ X.com */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.loading-screen.hide {
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    width: 150px;
    height: 150px;
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
    
    /**/
    opacity: 1 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Main Content */
#main-content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

#main-content.show {
    opacity: 1;
}

/* LOGO */
.main-header .logo {
    margin-top: 60px;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    z-index: 100;
    transition: background-color var(--animation-duration) ease-in-out;
}

.main-header.scrolled {
    background-color: var(--menu-bg);
}

.logo img {
    width: 200px;
}

.main-nav ul {
    display: flex;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    position: relative;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.main-nav a::after {
    content: attr(data-text);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--hover-color);
    font-size: 10px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.main-nav a:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.main-nav a:hover {
    color: var(--hover-color);
}

.secondary-nav ul {
    display: flex;
}

.secondary-nav li {
    margin-left: 20px;
}

.secondary-nav a {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.secondary-nav a:hover {
    color: var(--hover-color);
}

/* Mobile Menu Button (Hamburger) */
.menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 101;
}

.hamburger {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--secondary-color);
    position: relative;
    transition: all 0.3s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 3px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease-in-out;
}

.hamburger::before {
    transform: translateY(-10px);
}

.hamburger::after {
    transform: translateY(10px);
}

.menu-btn.open .hamburger {
    background: transparent;
}

.menu-btn.open .hamburger::before {
    transform: rotate(45deg);
}

.menu-btn.open .hamburger::after {
    transform: rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: var(--menu-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform var(--animation-duration) ease-in-out;
    z-index: 99;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu ul {
    text-align: center;
}

.mobile-menu li {
    margin: 20px 0;
}

.mobile-menu a {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.mobile-menu a:hover {
    color: var(--hover-color);
}

/* Hero Sections */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0 50px 100px 50px;
    background-size: cover;
    background-position: center;
    color: var(--secondary-color);
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Background images for hero sections */
#hero1 {
    background-image: url('https://www.spacex.com/static/images/starlink_hero_mobile.webp');
}

#hero2 {
    background-image: url('https://www.spacex.com/static/images/starship_hero_mobile.webp');
}

#hero3 {
    background-image: url('https://www.spacex.com/static/images/crew_dragon_hero_mobile.webp');
}

#hero4 {
    background-image: url('https://www.spacex.com/static/images/falcon9_hero_mobile.webp');
}

.hero-content {
    animation: fadeInUp 1s ease-out forwards;
}

.hero-content h2 {
    font-size: 20px;
    font-weight: 400;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1.5px;
}

.hero-content h1 {
    font-size: 60px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.btn {
    display: inline-block;
    border: 2px solid var(--secondary-color);
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 30px 50px;
    text-align: center;
}

footer ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

footer li {
    margin: 0 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

footer a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-nav, .secondary-nav {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .main-header {
        padding: 0 30px;
    }

    .logo img {
        width: 180px;
    }

    .hero-section {
        padding: 0 30px 80px 30px;
    }

    .hero-content h1 {
        font-size: 45px;
    }
}

@media (max-width: 768px) {
    .main-header {
        height: 70px;
    }

    .hero-content h1 {
        font-size: 35px;
    }

    .hero-content h2 {
        font-size: 16px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    footer li {
        margin: 5px 10px;
    }
}

@media (max-width: 576px) {
    .main-header {
        padding: 0 20px;
    }

    .logo img {
        width: 150px;
    }

    .hero-section {
        padding: 0 20px 60px 20px;
    }

    .hero-content h1 {
        font-size: 28px;
    }
}

/* Desktop-specific styles for menu hover effect */
@media (min-width: 993px) {
    .main-nav a::after {
        opacity: 0;
        transform: translateY(5px);
    }

    .main-nav a:hover::after {
        opacity: 1;
        transform: translateY(0);
    }
}