/* --- Base, Loader, and Background Styles --- */
:root {
    --bg-light: #f4f4f4;
    --text-light: #000000; /* Pure black for light mode text */
    --panel-light: rgba(255, 255, 255, 0.7);
    --border-light: rgba(0, 0, 0, 0.1);
    --card-light: #efefefe6;

    --bg-dark: #000;
    --text-dark: #ffffff; /* White for dark mode text */
    --panel-dark: rgba(30, 30, 30, 0.8);
    --border-dark: rgba(255, 255, 255, 0.2);
}

/* Performance optimizations */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    background-color: var(--bg-light);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-light);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}
body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

#spline-background {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    pointer-events: none; transform: translateZ(0); will-change: transform; backface-visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: none;
    contain: layout style paint;
}

body.dark-mode #spline-background {
    opacity: 1;
    display: block;
}


/* --- Custom Cursor --- */
.cursor {
    width: 25px; height: 25px; border: 2px solid white; border-radius: 50%;
    position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
    mix-blend-mode: difference; transition: all 0.2s ease-out;
    display: flex; justify-content: center; align-items: center;
}
.cursor-text { font-size: 10px; color: white; opacity: 0; transition: opacity 0.2s ease-out; font-weight: bold; mix-blend-mode: difference; }
.cursor.active { width: 80px; height: 20px; border-radius: 0; background-color: white; }
.cursor.active .cursor-text { opacity: 1; mix-blend-mode: difference; }

/* Removed duplicate box-sizing rule - now handled above */

/* --- Scroll & Load --- */
.animate-on-load, .animate-on-scroll {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.is-visible { opacity: 1; transform: translateY(0); }

/* --- Navigation Bar --- */
#navigationbar {
    position: fixed; top: 0; left: 0; width: 100%; display: flex;
    justify-content: space-between; align-items: center; padding: 20px 40px;
    z-index: 100; box-sizing: border-box;
}
.nav-right { display: flex; align-items: center; gap: 25px; }
.nav-name { font-size: 1.5em; font-weight: bold; }
.nav-brand-link { text-decoration: none; color: var(--text-light); }
body.dark-mode .nav-brand-link { color: var(--text-dark); }
.nav-links { display: flex; gap: 25px; }
.navbar-link { text-decoration: none; color: var(--text-light); font-weight: bold; padding: 5px; position: relative; }
body.dark-mode .navbar-link { color: var(--text-dark); }
.navbar-link::after { content: ''; position: absolute; width: 100%; height: 1px; bottom: 0; left: 0; background-color: var(--text-light); transform: scaleX(0); transform-origin: bottom right; transition: transform 0.3s ease-out; }
body.dark-mode .navbar-link::after { background-color: var(--text-dark); }
.navbar-link:hover::after { transform: scaleX(1); transform-origin: bottom left; }
.navbar-link.active::after { transform: scaleX(1); transform-origin: bottom left; }
.navbar-link.active { color: #ffd700 !important; }
.hamburger { display: none; }
.hamburger .bar { width: 25px; height: 3px; background-color: var(--text-light); border-radius: 5px; }
body.dark-mode .hamburger .bar { background-color: var(--text-dark); }

/* --- Theme Toggle --- */
#theme-toggle { cursor: pointer; width: 24px; height: 24px; position: relative; }
#theme-toggle svg { position: absolute; width: 100%; height: 100%; transition: opacity 0.3s ease, transform 0.3s ease; color: var(--text-light); }
body.dark-mode #theme-toggle svg { color: var(--text-dark); }
#theme-toggle .sun { opacity: 0; transform: scale(0.8); }
#theme-toggle .moon { opacity: 1; transform: scale(1); }
body.dark-mode #theme-toggle .sun { opacity: 1; transform: scale(1); }
body.dark-mode #theme-toggle .moon { opacity: 0; transform: scale(0.8); }

/* --- Main Content --- */
#main-content { opacity: 1; transition: opacity 1s ease-in-out; }
.full-page-section {
    position: relative; width: 100vw; height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; padding: 20px; box-sizing: border-box;
}
.content-panel {
    background-color: var(--panel-light); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light); border-radius: 20px;
    padding: 40px; max-width: 1480px; width: 90%;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
body.dark-mode .content-panel { background-color: var(--panel-dark); border: 1px solid var(--border-dark); }

/* --- Section Specific--- */
#header {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 90%; max-width: 800px; z-index: 0; pointer-events: none;
    display: flex; justify-content: center; align-items: center; background: rgba(0,0,0,0);
}
#header h1 {
    text-align: justify; font-size: 2.5em; width: 100%; background: transparent;
    position: relative; z-index: 1; will-change: transform; transform: translateZ(0);
    color: var(--text-light);font-family: Courier New;
}
body.dark-mode #header h1 { color: var(--text-dark); }
.highlight-font { font-family:Georgia, 'Times New Roman', Times, serif; font-weight: 500; }
#home { background-color: transparent; z-index: -1; }

#about_me_sec { background-color: #ffffff; color: var(--text-light); z-index: 2; }
body.dark-mode #about_me_sec { background-color: #111111; color: #f0f0f0; }
#about_me_sec .content-panel { background-color: transparent; border: none; backdrop-filter: none; }
#about_me_sec_para1 { text-align: justify; font-size: 1.2em; }
#about_me_sec_para1_h1 { font-size: 1.8em; text-align: center; display: block; margin-bottom: 20px; }

#Social_me_sec { background-color: var(--bg-light); z-index: 3; }
body.dark-mode #Social_me_sec { background-color: var(--bg-dark); }
.social-container { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 60px; }
.social-icon { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text-light); }
body.dark-mode .social-icon { color: var(--text-dark); }
.social-icon:nth-child(2), .social-icon:nth-child(4) { margin-top: 80px; }
.social-icon img { border-radius: 50%; width: 60px; height: 60px; margin-bottom: 8px; }

#about_me { background-color: #ffffff; color: var(--text-light); z-index: 4; }
body.dark-mode #about_me { background-color: #111111; color: #f0f0f0; }
.content-align-left { align-items: flex-start; }
#about_me .content-panel { margin-left: 5%; background-color: transparent; border: none; backdrop-filter: none; }
#about_me h2 { font-size: 1.8em; }
#about_me p { text-align: justify; font-size: 1.1em; line-height: 1.6; }

/* --- HORIZONTAL SCROLL --- */
.horizontal-scroll-container { height: 400vh; position: relative; background-color: #ffffff; z-index: 5; }
body.dark-mode .horizontal-scroll-container { background-color: var(--bg-dark); }
.sticky-wrapper { position: sticky; top: 0; height: 100vh; width: 100%; overflow-x: hidden; }
.scroll-content { height: 100%; width: max-content; display: flex; align-items: center; gap: 60px; padding: 0 15vw; will-change: transform; }
.scroll-content { scrollbar-width: none; -ms-overflow-style: none; }
.scroll-content::-webkit-scrollbar { display: none; }

.project-card {
    background-color: var(--card-light);
    border: 1px solid #616161;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-radius: 20px;
    padding: 50px;
    width: 450px;
    height: 550px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: background-color 0.4s ease, border-color 0.4s ease;
    color: var(--text-light);
}
body.dark-mode .project-card {
    background-color: var(--panel-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-dark);
    box-shadow: none;
    color: var(--text-dark);
}
.project-card h2 {
    font-size: 1em;
    margin-bottom: 10px;
    text-align: center;
}
.project-description {
    font-size: 0.9em;
    line-height: 1.7;
    margin-bottom: 30px;
    text-align: center;
    flex-grow: 1;
    padding: 0 10px;
    color: var(--text-light);
}
body.dark-mode .project-description {
    color: #ccc;
}
.tech-stack {
    font-size: 0.7em;
    text-align: center;
    margin-top: auto;
    padding: 0 10px;
    color: var(--text-light);
}
body.dark-mode .tech-stack {
    color: var(--text-dark);
}
.project-link { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }

/* Scroll buttons (hidden by default, shown on mobile) */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
}
.scroll-btn.left { left: 8px; }
.scroll-btn.right { right: 8px; }
.scroll-btn svg { width: 20px; height: 20px; }
.scroll-btn.disabled { opacity: 0.35; pointer-events: none; }

#Testimonials { background-color: var(--bg-light); color: var(--text-light); z-index: 6; }
body.dark-mode #Testimonials { background-color: #111111; color: var(--text-dark); }

/* Dark mode testimonial styles */
body.dark-mode .testimonial-text { color: #ffffff; }
body.dark-mode .author-name { color: #ffffff; }
body.dark-mode .author-title { color: #cccccc; }
body.dark-mode .author-initials { background: #666666; color: #ffffff; }
#Testimonials_header { font-size: 2em; text-align: center; margin-bottom: 30px; }
.testimonials-container { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 24px;
    max-width: 350px;
    flex: 1 1 280px; 
    min-width: 280px;
}

body.dark-mode .testimonial-card {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.testimonial-text { font-style: italic; color: #000000; }
.testimonial-author { display: flex; align-items: center; margin-top: 18px; }
.author-initials { background: #4a4a4a; color: #ffffff; border-radius: 50%; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-weight: bold; margin-right: 12px; }
.author-name { font-weight: bold; color: #000000; }
.author-title { font-size: 0.95em; color: #2c2c2c; font-weight: 600; }

/* --- CONTACT SECTION --- */
#Contact { background-color: var(--bg-light); z-index: 7; text-align: center; }
body.dark-mode #Contact { background-color: var(--bg-dark); }
#Contact .content-panel { background-color: transparent; border: none; backdrop-filter: none; }
#Contact h2 { font-size: 2.5em; margin-bottom: 20px; }
#Contact p { font-size: 1.1em; max-width: 600px; margin: 0 auto 40px auto; color: #000000; }
body.dark-mode #Contact p { color: #ccc; }
.contact-details { display: flex; flex-direction: column; gap: 20px; font-size: 1.5em; }
.contact-item a { text-align: center;overflow:scroll; color: var(--text-light); text-decoration: none; transition: color 0.3s ease; }
body.dark-mode .contact-item a { color: var(--text-dark); }
.contact-item a:hover { color: #1b616a; }
body.dark-mode .contact-item a:hover { color: #38bdf8; }

/* --- Media Query --- */
@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor { display: none; }
    .animate-on-load, .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .content-panel {
        padding: 32px 24px;
    }
    #navigationbar { background-color: rgba(255, 255, 255, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 15px 20px; }
    body.dark-mode #navigationbar { background-color: rgba(30, 30, 30, 0.5); }
    .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; right: 20px; background-color: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); border-radius: 10px; padding: 20px; width: 200px; gap: 15px; }
    body.dark-mode .nav-links { background-color: rgba(0, 0, 0, 0.8); }
    .nav-links.active { display: flex; }
    .hamburger { display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
    #header { position: relative; transform: none; top: 200px; left: auto; padding: 80px 20px 40px 20px; text-align: center; width: 100%; z-index: 1; }
    #header h1 { font-size: 1.8em; text-align: center; }
    .full-page-section { height: auto; min-height: 100vh; }
    .horizontal-scroll-container { height: auto; }
    .sticky-wrapper { position: static; height: auto; }
    /* Enable horizontal scroll with snap on mobile */
    .scroll-content {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        width: 100%;
        height: auto;
        padding: 40px 16px;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .scroll-btn { display: flex; }
    .project-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 500px;
        scroll-snap-align: start;
    }
    .social-icon:nth-child(even) { margin-top: 0; }
}

@media (max-width: 480px) {
    #about_me_sec_para1 { font-size: 1em; }
    #about_me h2 { font-size: 1.5em; }
    #about_me p { font-size: 1em; }
    .project-card { padding: 20px; }
    .testimonials-container { gap: 15px; }
    .testimonial-card {
        flex-basis: 100%;
        min-width: 0;
    }
    .content-panel {
        padding: 24px 16px;
    }
    #Contact h2 { font-size: 2em; }
    .contact-details { font-size: 1.2em; }
}
