/* Global Styles & Variables */
:root {
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-color: #3498db;
    --text-color: #f8f8f8;
    --bg-color: #121212;
    --border-color: #ffffff;
    --transition-speed: 0.5s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    background-color: var(--bg-color);
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    background-image: url('images/rocket-launch.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 5;
    transition: var(--transition-speed);
}

#main-name {
    font-size: 5rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.subtitle {
    font-size: 1.8rem;
    margin-top: 1rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    animation: bounce 2s infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0) translateX(-50%);}
    40% {transform: translateY(-20px) translateX(-50%);}
    60% {transform: translateY(-10px) translateX(-50%);}
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
}

#navbar.visible {
    transform: translateY(0);
}

.nav-name {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: bold;
}

.contact-btn {
    background-color: transparent;
    color: var(--secondary-color);
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

.contact-btn:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.contact-btn:hover:after {
    width: 80%;
}

/* Main Content Section */
main {
    position: relative;
    z-index: 10;
    background-color: var(--bg-color);
    padding: 80px 0;
}

.main-content-wrapper {
    position: relative;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    width: 100%;
    overflow-x: hidden;
}

.main-content-wrapper.slide-left {
    transform: translateX(-100%);
}

.experiences {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    padding-top: 150px; /* Added extra padding to create more space between hero and first experience */
}

/* Experience Cards */
.experience-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 120px;
    position: relative;
    transition: all 0.5s ease;
}

@media (min-width: 768px) {
    .experience-card {
        flex-direction: row;
        align-items: center;
    }
    
    .experience-card:nth-child(even) {
        flex-direction: row-reverse;
    }
}

.experience-image-container {
    flex: 1;
    overflow: hidden;
    border: 4px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.5s ease;
    position: relative;
    max-height: 400px;
}

.experience-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: grayscale(100%);
}

/* Make the entire card trigger the color change, not just image hover */
.experience-card:hover .experience-image {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* For mobile - always show colored images */
@media (max-width: 767px) {
    .experience-image {
        filter: grayscale(0%);
    }
}

.experience-content {
    flex: 1;
    padding: 20px;
}

.experience-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.experience-content p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.learn-more-btn {
    padding: 10px 25px;
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.learn-more-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Experience Detail Pages */
.experience-details {
    position: fixed;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 200;
    transition: left 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    overflow-y: auto;
}

.experience-details.active {
    left: 0;
}

.detail-container {
    min-height: 100vh;
    position: relative;
}

.detail-header {
    height: 70vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.detail-header-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-title {
    position: absolute;
    bottom: 50px;
    left: 50px;
    font-size: 3rem;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.detail-content {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

.detail-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.1rem;
}

.back-to-main {
    display: inline-block;
    padding: 10px 25px;
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: 30px;
    margin-bottom: 50px;
    text-decoration: none;
    border-radius: 4px;
}

.back-to-main:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Footer */
footer, .detail-footer {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 50px 20px;
    margin-top: 50px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.footer-content h2 {
    margin-bottom: 20px;
    font-size: 2rem;
    color: var(--secondary-color);
    width: 100%;
    text-align: center;
}

.contact-links {
    display: flex;
    flex-direction: row;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.contact-item i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.contact-item:hover {
    color: var(--accent-color);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
    gap: 20px;
}

#back-to-top, .detail-back-to-top {
    padding: 15px 30px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 30px;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

#back-to-top:before, .detail-back-to-top:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

#back-to-top:hover:before, .detail-back-to-top:hover:before {
    left: 100%;
}

#back-to-top:hover, .detail-back-to-top:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Media Queries */
@media screen and (max-width: 768px) {
    #main-name {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .experience-image-container {
        max-height: 300px;
    }
    
    .experience-content h2 {
        font-size: 1.8rem;
    }
    
    .detail-title {
        font-size: 2.5rem;
        left: 20px;
    }
    
    /* Ensure contact links stack properly on mobile */
    .contact-links {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }
    
    /* Fix horizontal overflow */
    body, html {
        overflow-x: hidden;
        width: 100%;
        position: relative;
        max-width: 100%;
    }
    
    main,
    .experiences,
    footer,
    .main-content-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* Fix experience card vertical alignment on mobile */
    .experience-card {
        flex-direction: column !important; /* Override any flex-direction from larger screens */
        align-items: center !important; 
        text-align: center;
        padding: 0 20px;
    }
    
    .experience-image-container {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .experience-content {
        width: 100%;
        padding: 0;
    }
    
    /* Ensure detail pages slide in properly */
    .experience-details {
        width: 100%;
        left: 100%;
    }
}

@media screen and (max-width: 480px) {
    #main-name {
        font-size: 2.5rem;
    }
    
    .experience-content h2 {
        font-size: 1.5rem;
    }
    
    .detail-title {
        font-size: 2rem;
    }
    
    .footer-content h2 {
        font-size: 1.8rem;
    }
    
    .experience-card {
        margin-bottom: 80px;
    }
}