/*best practice to remove default spacing*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

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

/*web page info content starts HERE*/
.container {
    /*container is the main wrapper for the entire web page content*/
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* inside webpage container - Side Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(139, 92, 246, 0.2);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(139, 92, 246, 0.1);
}

/*in this case: Ruby Cho*/
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 1.6rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    position: relative;
}

/*Adds a horizontal, gradient-colored line just below the logo text.*/
.logo::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    /*This line is styled to have a gradient effect*/
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    /*and a glowing shadow, below is a notiable example of the glowing shadow*/
    /*box-shadow: 0 0 20px 8px rgba(139, 92, 246, 1);*/
}

/*.nav-meny is an unordered list*/
.nav-menu {
    list-style: none;
    /*removes the default bullet points from the list*/
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 1.5rem;
}

.nav-link {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 8px;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.1));
    transition: width 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    border-left-color: #8b5cf6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: auto;
    padding-top: 2rem;
    margin-left: -0.5rem;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.social-link {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 6px;
    position: relative;
}

.social-link:hover {
    color: #8b5cf6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    transform: translateY(-2px);
}

/* Main Content */
body.sidebar-open .main-content {
    margin-left: auto;
    margin-right: auto;
    max-width: 900px;
    transition: margin-left 0.3s ease;
}

/* Sidebar closed: center main content */
body:not(.sidebar-open) .main-content {
    margin-left: auto;
    margin-right: auto;
    max-width: 900px;
    transition: margin-left 0.3s ease;
}

.section {
    margin-bottom: 6rem;
}


/* Hero Section */
.hero {
    padding: 6rem 0;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.hero .subtitle {
    font-size: 1.8rem;
    color: #8b5cf6;
    margin-bottom: 2rem;
    font-weight: 500;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.hero .description {
    font-size: 1.2rem;
    color: #cbd5e1;
    max-width: 600px;
    line-height: 1.8;
}

/* Section Headers */
.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 3rem;
    position: relative;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.8);
}

/* About Section */
.about-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #cbd5e1;
    background: rgba(15, 15, 35, 0.4);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
}

.about-content p {
    margin-bottom: 1.5rem;
}

/* Projects Section */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

/*
.all-projects-link {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
}

.all-projects-link:hover {
    background: rgba(139, 92, 246, 0.1);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    border-color: #8b5cf6;
}
    */

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

.project {
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
    /* Ensures the project card is responsive */
}

.project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project:hover::before {
    opacity: 1;
}

.project:hover {
    transform: translateY(-8px);
    border-color: #8b5cf6;
    box-shadow:
        0 12px 40px rgba(139, 92, 246, 0.2),
        0 0 0 1px rgba(139, 92, 246, 0.3);
}

.project-year {
    color: #8b5cf6;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.project-description {
    color: #cbd5e1;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.project-buttons {
    display: flex;
    gap: 1rem;
}

.project-btn {
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(139, 92, 246, 0.5);
    background: transparent;
    color: #8b5cf6;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.project-btn:hover::before {
    left: 100%;
}

.project-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    transform: translateY(-2px);
}


.project-badge {
    display: inline-block;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 columns for 4 items */
    gap: 2rem;
}

.contact-item {
    background: rgba(15, 15, 35, 0.4);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.contact-item:hover::before {
    width: 200px;
    height: 200px;
}

.contact-item:hover {
    transform: translateY(-5px);
    border-color: #8b5cf6;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.contact-item h3 {
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.contact-item p {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-item p:hover {
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
    opacity: 0.9;
}

.sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar.open {
    transform: translateX(0);
}

/* Mobile Responsive */

@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .main-content {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.4rem;
    }

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

}

@media (max-width: 600px) {
    .sidebar {
        width: 80vw;
        min-width: 0;
        max-width: 100vw;
        padding: 1rem;
    }

    .social-links {
        margin-left: 5%;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*star background*/
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    /* allows clicks through the particles */
}

/*shooting stars animation */
.shooting-star {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 2px;
    background: linear-gradient(-45deg, #9d95ff, rgba(0, 0, 255, 0));
    filter: drop-shadow(0 0 6px #ab9fff);
    animation: tail 3000ms ease-in-out infinite, shooting 3000ms ease-in-out infinite;
    z-index: 3;
    opacity: 0.6;
}

.shooting-stars .shooting-star::before,
.shooting-star::after {
    position: absolute;
    content: '';
    top: calc(50% - 1px);
    right: 0;
    height: 2px;
    background: linear-gradient(-45deg, rgba(0, 0, 255, 0), #ab9fff, rgba(0, 0, 255, 0));
    border-radius: 100%;
    transform: translateX(50%) rotateZ(45deg);
    animation: shining 3000ms ease-in-out infinite;
}

.shooting-stars .shooting-star::after {
    transform: translateX(50%) rotateZ(-45deg);
}

.shooting-stars .shooting-star:nth-child(1) {
    top: 5%;
    left: 80%;
    animation-delay: 650ms;
}

.shooting-stars .shooting-star:nth-child(1)::before,
.shooting-star:nth-child(1)::after {
    animation-delay: 650ms;
}

.shooting-stars .shooting-star:nth-child(2) {
    top: 50%;
    left: 70%;
    animation-delay: 150ms;
}

.shooting-stars .shooting-star:nth-child(2)::before,
.shooting-stars .shooting-star:nth-child(2)::after {
    animation-delay: 150ms;
}

.shooting-stars .shooting-star:nth-child(3) {
    top: 85%;
    left: 5%;
    animation-delay: 1600ms;
}

.shooting-stars .shooting-star:nth-child(3)::before,
.shooting-star:nth-child(3)::after {
    animation-delay: 1600ms;
}


/* Animations */
@keyframes tail {
    0% {
        width: 0;
    }

    30% {
        width: 100px;
    }

    100% {
        width: 0;
    }
}

@keyframes shining {
    0% {
        width: 0;
    }

    50% {
        width: 30px;
    }

    100% {
        width: 0;
    }
}

@keyframes shooting {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(320px);
    }
}