/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.7;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #000000;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
}

.theme-toggle.visible {
    opacity: 1;
    pointer-events: auto;
}

.theme-toggle:hover {
    background: #333333;
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1.2rem;
}

body.dark-mode .theme-toggle {
    background: #000000;
    color: #ffffff;
}

body.dark-mode .theme-toggle:hover {
    background: #333333;
}

/* Dot Nav */
.dot-nav {
    position: fixed;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #cccccc;
    border-radius: 50%;
    display: block;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot:hover {
    background-color: #666666;
    transform: scale(1.2);
}

.dot.active {
    background-color: #666666;
    transform: scale(1.4);
}

body.dark-mode .dot {
    background-color: #666666;
}

body.dark-mode .dot:hover,
body.dark-mode .dot.active {
    background-color: #cccccc;
}

/* Intro Header */
.intro {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 2.5rem;
    background: #f8f8f8;
    position: relative;
    z-index: 1;
    scroll-snap-align: start;
}

body.dark-mode .intro {
    background: #2a2a2a;
}

.intro-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.intro-photo {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-mode .intro-photo {
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.intro-text {
    text-align: center;
    max-width: 600px;
}

.intro h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0;
}

.intro-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: #999999;
    margin: 0;
}

body.dark-mode .intro-title {
    color: #aaaaaa;
}

.contact-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.contact-icons a {
    color: #ffffff;
    font-size: 1.5rem;
    background: #000000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.contact-icons a:hover {
    background: #333333;
    transform: translateY(-3px);
}

body.dark-mode .contact-icons a {
    background: #ffffff;
    color: #000000;
}

body.dark-mode .contact-icons a:hover {
    background: #cccccc;
}

.cv-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background: transparent;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.3s ease;
}

.cv-button:hover {
    background: #333333;
    color: #ffffff;
    transform: translateY(-3px);
}

body.dark-mode .cv-button {
    color: #ffffff;
    border: 2px solid #ffffff;
}

body.dark-mode .cv-button:hover {
    background: #cccccc;
    color: #000000;
}

.intro-nav {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-nav a {
    color: #333333;
    text-decoration: none;
    margin: 0 1.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.intro-nav a:hover {
    color: #666666;
}

body.dark-mode .intro-nav a {
    color: #ffffff;
}

body.dark-mode .intro-nav a:hover {
    color: #cccccc;
}

/* Ensure no Swiper elements in intro */
.intro .swiper-container,
.intro .swiper-pagination,
.intro .swiper-button-next,
.intro .swiper-button-prev {
    display: none !important;
}

/* Sections */
section {
    width: 100%;
    max-width: 100vw;
    padding: 0 2.5rem;
    scroll-snap-align: start;
}

h2 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #000000;
    text-align: center;
    width: 100%;
}

body.dark-mode h2 {
    color: #ffffff;
}

/* About */
#about {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.about-text {
    max-width: 800px;
    width: 100%;
}

.about-text p {
    font-size: 1rem;
    color: #333333;
    text-align: justify;
    margin-bottom: 1.5rem;
}

body.dark-mode .about-text p {
    color: #cccccc;
}

/* Experience */
#experience {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    justify-items: center;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #d0d0d0;
    transition: transform 0.3s ease;
    width: 100%;
    max-width: 300px;
}

body.dark-mode .stat-card {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #444444;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    color: #666666;
    margin-bottom: 1rem;
}

body.dark-mode .stat-icon {
    color: #cccccc;
}

.stat-card h3 {
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

body.dark-mode .stat-card h3 {
    color: #ffffff;
}

.stat-card p {
    font-size: 1rem;
    color: #666666;
}

body.dark-mode .stat-card p {
    color: #cccccc;
}

/* Skills */
#skills {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 2.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 1200px;
    width: 100%;
    background: transparent;
    padding: 1.5rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.skill-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border: none;
    box-shadow: none;
}

.skill-icon.light-mode {
    display: block;
}

.skill-icon.dark-mode {
    display: none;
}

body.dark-mode .skill-icon.light-mode {
    display: none;
}

body.dark-mode .skill-icon.dark-mode {
    display: block;
}

.skill-item p {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333333;
    margin-top: 0.5rem;
    text-align: center;
}

body.dark-mode .skill-item p {
    color: #cccccc;
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 1rem;
    }

    .skill-item img {
        width: 80px;
        height: 80px;
    }

    .skill-item p {
        font-size: 0.85rem;
        font-weight: 500;
    }
}

/* Projects */
#projects {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2.5rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #000000;
}

body.dark-mode h3 {
    color: #ffffff;
}

.project {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

body.dark-mode .project {
    background: rgba(0, 0, 0, 0.9);
}

.project:hover {
    transform: translateY(-5px);
}

.project h4 {
    font-size: 1.3rem;
    font-weight: 500;
    color: #000000;
    margin-bottom: 0.5rem;
}

body.dark-mode .project h4 {
    color: #ffffff;
}

.project p {
    color: #333333;
}

body.dark-mode .project p {
    color: #cccccc;
}

.swiper-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    border-radius: 33px;
    z-index: 0;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
}

.swiper-slide img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 33px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-mode .swiper-slide img {
    border: 1px solid #444444;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.swiper-button-next, .swiper-button-prev {
    color: #666666;
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

body.dark-mode .swiper-button-next,
body.dark-mode .swiper-button-prev {
    color: #cccccc;
    background: rgba(0, 0, 0, 0.8);
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background: rgba(200, 200, 200, 0.8);
}

body.dark-mode .swiper-button-next:hover,
body.dark-mode .swiper-button-prev:hover {
    background: rgba(100, 100, 100, 0.8);
}

.swiper-button-next {
    right: 20px;
}

.swiper-button-prev {
    left: 20px;
}

.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 1.1rem;
}

.swiper-pagination {
    position: absolute;
    bottom: -20px;
    width: 100%;
    text-align: center;
}

.swiper-pagination-bullet {
    background: #cccccc;
    opacity: 0.7;
}

body.dark-mode .swiper-pagination-bullet {
    background: #666666;
}

.swiper-pagination-bullet-active {
    background: #666666;
    opacity: 1;
}

body.dark-mode .swiper-pagination-bullet-active {
    background: #cccccc;
}

/* Contact and Footer */
#contact {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 2.5rem;
    scroll-snap-align: start;
    position: relative;
}

.contact-footer-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    flex-grow: 1;
}

.contact-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.contact-links {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
    justify-content: center;
}

.contact-links a {
    color: #ffffff;
    font-size: 1.8rem;
    background: #000000;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.contact-links a:hover {
    background: #333333;
    transform: translateY(-3px);
}

body.dark-mode .contact-links a {
    background: #ffffff;
    color: #000000;
}

body.dark-mode .contact-links a:hover {
    background: #cccccc;
}

footer {
    width: 100vw;
    text-align: center;
    background: #ffffff;
    color: #333333;
    padding: 2rem 0;
    border-top: 1px solid #e0e0e0;
    margin: 0;
}

body.dark-mode footer {
    background: #1a1a1a;
    color: #ffffff;
    border-top: 1px solid #444444;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content nav {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-content nav a {
    color: #333333;
    text-decoration: none;
    margin: 0 1.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-content nav a:hover {
    color: #666666;
}

body.dark-mode .footer-content nav a {
    color: #ffffff;
}

body.dark-mode .footer-content nav a:hover {
    color: #cccccc;
}

.footer-content p {
    font-size: 0.9rem;
    color: #666666;
}

body.dark-mode .footer-content p {
    color: #cccccc;
}

/* Responsive */
@media (max-width: 768px) {
    .intro-content {
        flex-direction: column;
        text-align: center;
    }

    .intro-photo {
        width: 300px;
        height: 300px;
    }

    .intro-text {
        text-align: center;
    }

    .intro h1 {
        font-size: 2.3rem;
    }

    .intro-title {
        font-size: 1.3rem;
    }

    .contact-icons {
        margin-top: 1rem;
        justify-content: center;
    }

    .cv-button {
        margin-top: 1rem;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .intro-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto;
        grid-template-areas: 
            "about experience skills"
            ". projects contact";
        gap: 0.3rem;
        justify-items: center;
        align-items: center;
        margin: 2rem auto;
        padding: 0.5rem;
        width: 100%;
        max-width: 300px;
        box-sizing: border-box;
    }

    .intro-nav a.nav-about {
        grid-area: about;
    }

    .intro-nav a.nav-experience {
        grid-area: experience;
    }

    .intro-nav a.nav-skills {
        grid-area: skills;
    }

    .intro-nav a.nav-projects {
        grid-area: projects;
        justify-self: center;
    }

    .intro-nav a.nav-contact {
        grid-area: contact;
        justify-self: center;
    }

    .intro-nav a {
        margin: 0;
        font-size: 0.8rem;
        padding: 0.2rem;
        text-align: center;
    }

    section {
        padding: 0 1.5rem;
    }

    h2 {
        font-size: 2rem;
        text-align: center;
    }

    #about, #experience, #skills {
        height: auto;
        min-height: 100vh;
    }

    .about-text p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        justify-items: center;
    }

    .stat-card {
        padding: 1.5rem;
        max-width: 300px;
    }

    .swiper-container {
        height: auto;
        border-radius: 33px;
    }

    .swiper-slide img {
        max-height: 600px;
        border-radius: 33px;
        object-fit: contain;
    }

    .swiper-button-next {
        right: 10px;
    }

    .swiper-button-prev {
        left: 10px;
    }

    .swiper-pagination {
        bottom: -40px;
    }

    .contact-links {
        flex-direction: row;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .contact-links a {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }

    .contact-footer-container {
        justify-content: space-between;
    }

    .contact-content {
        min-height: 50vh;
    }

    .footer-content nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        justify-items: center;
    }

    .footer-content nav a {
        margin: 0.5rem 0;
    }

    .theme-toggle {
        bottom: 15px;
        left: 15px;
        width: 36px;
        height: 36px;
    }

    .theme-toggle i {
        font-size: 1rem;
    }

    .dot-nav {
        right: 10px;
    }

    .dot {
        width: 6px;
        height: 6px;
    }
}

/* Narrow screens (single image slider) */
@media (max-width: 640px) {
    .swiper-container {
        width: fit-content;
        max-width: 100%;
        display: block;
        padding: 0;
        margin-left: auto;
        margin-right: auto;
    }

    .swiper-slide {
        width: fit-content;
        max-width: 100%;
    }

    .swiper-slide img {
        width: auto;
        max-width: 100%;
        height: auto;
        display: block;
    }

    .swiper-button-next {
        right: -5px;
    }

    .swiper-button-prev {
        left: -5px;
    }
}
