/* --- 1. Color Scheme & Base Setup --- */
:root {
    --bg-color: #f8f8f6;       /* Not plain white, a very light warm gray */
    --card-bg: #ffffff;      /* White cards to "pop" */
    --text-color: #333333;   /* Dark charcoal, not pure black */
    --accent-gold: #bda76b;  /* A muted, professional gold */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

    /* --- NEW: "Batman" Fun Mode Colors --- */
    --fun-bg: #111111;        /* Very dark grey (almost black) */
    --fun-card: #222222;      /* Dark grey card */
    --fun-accent: var(--accent-gold); /* Use the gold for accent */
    --fun-text: #eeeeee;      /* Light grey text */
    --fun-shadow: 0 4px 20px rgba(189, 167, 107, 0.1); /* Gold shadow */

    /* This makes the color change smooth */
    transition: background-color 0.4s ease, color 0.4s ease;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.4s ease;
    /* This ensures that if the page content isn't scrollable, the body itself won't be */
    overflow-x: hidden; 
}

/* --- NEW: Mobile Scroll Lock --- */
/* This is the magic rule. It prevents the body from scrolling
   ONLY when a page section is active. */
body.page-is-open {
    overflow: hidden;
}


/* --- 2. Homepage Layout --- */
.homepage-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
}

.homepage-intro {
    margin-bottom: 3rem;
}

.homepage-intro h1 {
    font-size: 2.5rem;
    font-weight: 300;
    transition: color 0.4s ease;
}

.homepage-intro p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0.5rem auto 0;
    transition: color 0.4s ease;
}

/* The grid of clickable sections */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.section-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-bottom-color 0.3s ease;
    border-bottom: 4px solid transparent; /* Placeholder for gold hover */
}

.section-card h2 {
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    transition: color 0.4s ease;
}

.section-card p {
    color: #777;
    transition: color 0.4s ease;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-bottom-color: var(--accent-gold);
}

/* --- 3. Full-Page Sections (The "Expanded" View) --- */

/* This container holds all the full-page sections */
.page-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Hidden by default, controls visibility of all pages */
    pointer-events: none; 
}

.page-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    
    /* Hidden by default */
    opacity: 0;
    pointer-events: none;
    
    /* Animation setup */
    transform: scale(0.95); /* Start slightly small */
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, background-color 0.4s ease;

    /* Allows content inside to scroll if it overflows */
    overflow-y: auto;
    /* Fixes scrolling on iOS */
    -webkit-overflow-scrolling: touch; 
}

/* The active state, triggered by JavaScript */
.page-section.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* --- 4. In-Page Content & Back Arrow --- */
.page-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem; /* Extra padding at top for back arrow */
}

.inbuilt-back-arrow {
    position: absolute;
    top: 2rem;
    left: 2rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-gold);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.4s ease;
    z-index: 10; /* Ensure it's above content */
}

.inbuilt-back-arrow:hover {
    transform: translateX(-5px);
}

/* Example content styling */
.page-content h1 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-gold);
    display: inline-block;
    padding-bottom: 0.5rem;
    transition: border-bottom-color 0.4s ease;
}

.page-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.page-content img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.page-content .video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
/* --- 5. Styles for Research Paper Download Cards --- */

/* This styles the <a> tag that wraps the download card */
.section-card-link-wrapper {
    text-decoration: none; /* Removes the blue underline */
    color: inherit; /* Makes the text inherit its color from parent */
    display: block; /* Allows the link to behave like a block */
}

/* This ensures the card inside the link still has its hover effect */
.section-card-link-wrapper .section-card {
    /* The hover effects from section 2 will apply, 
       but you could add more specific ones here if you wanted */
    width: 100%; /* Ensures it fills the wrapper */
}

/* --- 6. Styles for Achievements Page --- */

/* Style for the sub-section titles (Sports, Academic) */
.subsection-title {
    font-size: 2rem;
    font-weight: 300;
    color: var(--accent-gold);
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 0.5rem;
    margin-top: 3rem; /* Adds space between sections */
    margin-bottom: 1rem;
    transition: color 0.4s ease, border-bottom-color 0.4s ease;
}

/* This is the grid container for the pictures */
.achievement-gallery {
    display: grid;
    /* This grid is responsive: 
       - It creates columns that are at least 250px wide.
       - 'auto-fit' tells it to fill the row with as many columns as fit.
       - '1fr' means they will all stretch equally to fill the space.
    */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem; /* Space below each gallery */
}

/* This is the "trophy card" for each picture */
.achievement-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden; /* This keeps the image corners rounded */
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Styling for the image preview itself */
.achievement-card img,
.achievement-card video { /* Apply to video as well */
    width: 100%;
    height: 200px; /* Fixed height for a uniform gallery */
    
    /* This is the most important part:
       It scales the image to fill the container 
       without stretching or distorting it.
    */
    object-fit: cover; 
    display: block;
}

/* Styling for the caption below the image */
.achievement-card p {
    padding: 1rem;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
    margin: 0;
    text-align: center;
    transition: color 0.4s ease;
}

/* --- 7. Styles for Redesigned "About Me" Page --- */

/* New two-column grid layout */
.about-page-layout {
    display: grid;
    grid-template-columns: 1fr; /* Stacked by default on mobile */
    gap: 2.5rem;
    align-items: flex-start;
}

/* On medium screens and up, switch to 2 columns */
@media (min-width: 768px) {
    .about-page-layout {
        /* First column is 300px, second takes remaining space */
        grid-template-columns: 300px 1fr; 
    }
}

.about-visuals {
    text-align: center;
}

.profile-picture {
    width: 100%;
    max-width: 300px; /* Max width */
    height: auto;
    border-radius: 12px; /* A softer "squircle" */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 4px solid var(--card-bg);
    transition: border-color 0.4s ease;
}

.about-details .subsection-title {
    margin-top: 2rem; /* More space above "My Skills" */
}

/* New Skill Tag styling */
.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem; /* Space between tags */
    margin-top: 1.5rem;
}

.skill-tag {
    background-color: var(--card-bg);
    border: 1px solid #eee;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px; /* Pill shape */
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--accent-gold);
    color: var(--card-bg);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(189, 167, 107, 0.3);
}


/* --- 8. Styles for Redesigned "Contact" Page --- */

.contact-links-grid {
    display: grid;
    /* Responsive grid: 1 column on mobile, 2 on tablet, 3 on desktop */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem; /* Space above the cards */
}

.contact-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem 2rem;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Space between icon and text */
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    color: var(--accent-gold);
    border-color: #eee;
}

/* This targets the SVG icons */
.contact-card svg {
    flex-shrink: 0; /* Prevents icon from shrinking */
    fill: var(--accent-gold); /* Icon color */
    transition: fill 0.3s ease;
}

.contact-card:hover svg {
    fill: var(--accent-gold);
}

.contact-card-text {
    display: flex;
    flex-direction: column;
}

.contact-card-text strong {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    transition: color 0.3s ease;
}

.contact-card:hover .contact-card-text strong {
    color: var(--accent-gold);
}

.contact-card-text span {
    font-size: 0.9rem;
    color: #777;
    word-break: break-all;
    transition: color 0.4s ease;
}


/* --- 9. NEW: Fun Mode Toggle Switch (MOVED) --- */
.fun-mode-toggle-container {
    position: fixed; /* Fixed to viewport */
    bottom: 2rem;    /* 2rem from bottom */
    right: 2rem;     /* 2rem from right */
    z-index: 998;  /* Above content, below modal */
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #888;
    background-color: var(--card-bg); /* Add a subtle bg */
    padding: 0.5rem 1rem;
    border-radius: 30px;
    box-shadow: var(--shadow);
    transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

.fun-mode-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.fun-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.fun-mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.fun-mode-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .fun-mode-slider {
    background-color: var(--fun-accent);
}

input:focus + .fun-mode-slider {
    box-shadow: 0 0 1px var(--fun-accent);
}

input:checked + .fun-mode-slider:before {
    transform: translateX(24px);
}


/* --- 10. NEW: Fun Mode Theme Activation --- */
body.fun-mode-active {
    --bg-color: var(--fun-bg);
    --card-bg: var(--fun-card);
    --text-color: var(--fun-text);
    --accent-gold: var(--fun-accent);
    --shadow: var(--fun-shadow);

    background-color: var(--fun-bg);
    color: var(--fun-text);
}

/* Re-theme all components automatically */
body.fun-mode-active .homepage-intro p {
    color: #aaa;
}
body.fun-mode-active .section-card p {
    color: #ccc;
}
body.fun-mode-active .achievement-card p {
    color: #f0f0f0;
}
body.fun-mode-active .skill-tag {
    border-color: #444;
}
body.fun-mode-active .skill-tag:hover {
    box-shadow: 0 4px 15px rgba(189, 167, 107, 0.3);
}
body.fun-mode-active .profile-picture {
    border-color: var(--fun-card);
}
body.fun-mode-active .contact-card {
    border-color: transparent;
}
body.fun-mode-active .contact-card:hover {
    border-color: #444;
}
body.fun-mode-active .contact-card-text strong {
    color: #f0f0f0;
}
body.fun-mode-active .contact-card-text span {
    color: #ccc;
}
body.fun-mode-active .fun-mode-toggle-container {
    color: #888;
    background-color: var(--card-bg); /* Use card bg for dark mode */
}


/* --- 11. NEW: Joke Modal Styles --- */
.joke-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.joke-modal-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.joke-modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.joke-modal-overlay.is-active .joke-modal-content {
    transform: scale(1);
}

.joke-modal-content h3 {
    color: var(--accent-gold);
    margin-top: 0;
    margin-bottom: 1rem;
}

.joke-modal-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.joke-modal-button {
    background-color: var(--accent-gold);
    color: var(--card-bg);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.joke-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.fun-mode-active .joke-modal-button {
    color: #111;
}

/* --- 12. NEW: Fun Mode Travel Gallery Styles --- */
/* Target only achievement cards inside the travel page */
#page-travel .achievement-card {
    position: relative;
    background-color: transparent; /* Remove card background */
    padding: 0; /* Remove padding */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); /* Stronger shadow */
}

/* Make image fill the card */
#page-travel .achievement-card img {
    height: 300px; /* Taller images */
    border-radius: 8px; /* Apply radius to image itself */
}

/* Style for the text caption overlay */
#page-travel .travel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1rem 1rem;
    /* Gradient: 80% black at bottom, fading to 0% */
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Style for text inside the caption */
#page-travel .achievement-card p {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5); /* Text shadow */
    text-align: left;
    margin: 0;
    padding: 0;
}


/* --- 13. NEW: Mobile Responsive Styles --- */

/* These rules apply to any screen 640px wide or smaller */
@media (max-width: 640px) {

    /* --- Homepage --- */
    .homepage-container {
        /* Reduce padding on mobile */
        padding: 3rem 1.5rem; 
    }

    .homepage-intro h1 {
        font-size: 2rem; /* Make main title smaller */
    }

    /* --- General Page Content --- */
    .page-content {
        /* Reduce padding on mobile */
        padding: 5rem 1.5rem 3rem;
    }

    .page-content h1 {
        font-size: 2.2rem; /* Make section titles smaller */
    }

    .subsection-title {
        font-size: 1.7rem; /* Make sub-titles smaller */
    }

    /* --- Back Arrow --- */
    .inbuilt-back-arrow {
        top: 1.5rem;
        left: 1.5rem;
        font-size: 1.5rem; /* Make arrow smaller */
    }

    /* --- Grids --- */
    .section-grid {
        gap: 1rem; /* Reduce space between cards */
    }

    .achievement-gallery {
        gap: 1rem; /* Reduce space between pictures */
    }

    /* --- About Me Page --- */
    .about-page-layout {
        gap: 1.5rem; /* Reduce space between pic and text */
    }

    /* --- Contact Page --- */
    .contact-card {
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .contact-card svg {
        width: 28px;
        height: 28px;
    }

    .contact-card-text strong {
        font-size: 1rem;
    }

    /* --- Fun Mode Toggle --- */
    .fun-mode-toggle-container {
        /* Move it closer to the edge on mobile */
        bottom: 1rem;
        right: 1rem;
        padding: 0.4rem 0.8rem;
    }

    /* --- Joke Modal --- */
    .joke-modal-content {
        /* Reduce padding for small screens */
        padding: 1.5rem;
    }
}

