/* === START: GLOBAL STYLES & RESETS === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
  height: 100%;
  scroll-padding-top: 80px; /* Adjust based on header height */
  scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    /* ADD THESE NEW BACKGROUND PROPERTIES */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    transition: background-image 2s ease-in-out;
    /* ADD FLEXBOX LAYOUT TO PUSH FOOTER DOWN */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Add a subtle overlay to ensure text readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1); /* Changed from 0.85 to 0.3 */
    z-index: -1;
    pointer-events: none;
}
/* === END: GLOBAL STYLES & RESETS === */


/* === START: HEADER & NAVIGATION === */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px; /* Changed from 1rem 2rem to pixels */
    background-color: #000;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    color: #fff;
    font-size: 24px; /* Add this line - fixed pixel size */
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    font-size: 16px; /* Add this line - fixed pixel size */
}

/* --- START: REPLACEMENT FOR HOVER/ACTIVE STYLES --- */
/* Style for regular links on hover and the currently active section link */
.nav-links a:hover,
.nav-links a.active-link {
    background-color: #fff;
    color: #000;
}

/* This is the key: Keep the dropdown button white when hovering over the entire dropdown area */
.dropdown:hover > .dropbtn {
    background-color: #fff;
    color: #000;
}

/* This ensures the caret icon is also black in all active/hover states */
.nav-links a.active-link .fa-caret-down,
.dropdown:hover > .dropbtn .fa-caret-down {
    color: #000;
}
/* --- END: REPLACEMENT FOR HOVER/ACTIVE STYLES --- */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 29px;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
}

.dropdown-content a {
    color: black !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: center; /* Add this line */
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.hamburger {
    display: none;
}
/* === END: HEADER & NAVIGATION === */


/* === START: MAIN CONTENT & SECTIONS === */
main {
  flex-grow: 1; /* This makes main take up available space */
  max-width: 900px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  flex-direction: column;
}

main section {
  display: none;
  background-color: white;
  padding: 30px; /* Changed from 25px 30px to fixed pixels */
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin: 20px 0; /* Keep this in pixels too */
}

main section h2 {
  margin-bottom: 15px;
  color: #004080;
  text-align: center;
}

hr {
    border: 0;
    height: 1px;
    background-color: #e0e0e0;
    margin: 2rem 0;
}
/* === END: MAIN CONTENT & SECTIONS === */


/* === START: ABOUT SECTION === */
section#about {
    text-align: left;
    overflow: auto;
}

section#about p {
    margin-bottom: 1.2rem;
}

.profile-picture {
    display: block;
    width: 200px;
    height: auto;
    border-radius: 12px; /* Changed from 50% to create a rectangular shape */
    margin: 0 auto 1.5rem auto;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sub-section {
    margin-top: 2rem;
    padding-top: 1rem;
}

/* === START: ACCORDION STYLES === */
.accordion-container {
    clear: both; /* Ensures it doesn't wrap around the floated profile picture */
}

.accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-button {
    background-color: #fff;
    color: #333;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    position: relative;
}

.accordion-button:hover {
    background-color: #f8f9fa;
}

.accordion-button::after {
    content: '\2212'; /* Minus sign (since panels start open) */
    color: #007bff;
    font-weight: bold;
    position: absolute;
    right: 18px;
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.accordion-button.active::after {
    content: "\2212"; /* Keep minus sign when active */
}

/* Add this new rule for when accordion is closed */
.accordion-button:not(.active)::after {
    content: '\002B'; /* Plus sign when closed */
}

.accordion-panel {
    padding: 0 18px;
    background-color: white;
    max-height: 3000px; /* Increased from 500px to accommodate longer content */
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-panel p {
    margin-bottom: 1rem;
    line-height: 1.7;
}
/* === END: ACCORDION STYLES === */

.sub-section {
    margin-top: 2rem;
    padding-top: 1rem;
}

/* === START: NEW ICON BUTTON STYLES === */
.button-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #fff !important;
    border: none;
    min-width: 150px; /* Ensures buttons have a consistent width */
}

.icon-btn i {
    font-size: 1.2rem;
}

/* Color Classes */
.btn-gray { background-color: #6c757d; }
.btn-gray:hover { background-color: #5a6268; }

.btn-linkedin { background-color: #0A66C2; }
.btn-linkedin:hover { background-color: #004182; }

.btn-github { background-color: #161B22; }
.btn-github:hover { background-color: #010409; }

.btn-handshake { background-color: #5cb85c; }
.btn-handshake:hover { background-color: #449d44; }
/* === END: NEW ICON BUTTON STYLES === */
/* === END: ABOUT SECTION === */


/* === START: PROJECTS SECTION === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: #ececec; /* Changed from #fff to a light grey */
  border: 1px solid #b8b8b8;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 1.5rem;
  text-align: left;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.project-links {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    align-items: center;   /* Center the buttons horizontally */
    gap: 0.75rem;          /* Adjust gap for vertical layout */
}

.project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Center content within the button */
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #fff !important;
    width: 90%; /* Make buttons wider for a consistent look */
    max-width: 300px; /* Optional: set a max-width */
}

.github-btn { background-color: #6c757d; }
.github-btn:hover { background-color: #5a6268; }

.youtube-btn { background-color: #FF0000; }
.youtube-btn:hover { background-color: #c40202; }

.doc-btn { background-color: #007bff; }
.doc-btn:hover { background-color: #0056b3; }
/* === END: PROJECTS SECTION === */


/* === START: FILES & DOCUMENTS SECTION === */
.section-intro {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #666;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.file-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #fff;
}

.file-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #007bff;
}

.file-card h3 {
    margin: 0;
    font-size: 1.2rem;
}

.document-viewer {
    text-align: center;
}

.document-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 2rem;
    border-radius: 5px;
}

.document-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.document-actions .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-view { background-color: #007bff; color: #fff !important; }
.btn-view:hover { background-color: #0056b3; }

.btn-download { background-color: #28a745; color: #fff !important; }
.btn-download:hover { background-color: #1e7e34; }
/* === END: FILES & DOCUMENTS SECTION === */

/* === START: UNDER CONSTRUCTION BANNER === */
.under-construction-banner {
    background-color: #fff3cd; /* Light yellow background */
    border: 1px solid #ffeaa7; /* Slightly darker yellow border */
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #856404; /* Dark yellow/brown text */
}

.under-construction-banner i {
    color: #f39c12; /* Orange warning icon */
    font-size: 1.2rem;
}

.under-construction-banner span {
    flex-grow: 1;
    font-size: 1rem;
}
/* === END: UNDER CONSTRUCTION BANNER === */

/* === START: BOOKS SECTION === */
.books-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.book {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 250px;
  background-color: #ececec; /* Changed from #fff to a light grey */
  border: 1px solid #b8b8b8;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.book:hover {
  transform: translateY(-5px);
}

.book img {
  width: 150px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.book-info {
  text-align: center;
  margin-top: 1rem;
}

.book-info h3 { margin: 0; font-size: 1rem; }
.book-info p { margin: 0.5rem 0; font-size: 0.9rem; color: #444; }
.book-info a { color: #007bff; text-decoration: none; font-weight: bold; }
.book-info a:hover { text-decoration: underline; }
/* === END: BOOKS SECTION === */


/* === START: FOOTER === */
footer {
    background-color: #000;
    color: #fff;
    padding: 32px; /* Changed from 2rem to pixels */
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px; /* Changed from 3rem to pixels */
    /* Ensure footer stays at bottom */
    flex-shrink: 0;
}

.footer-social-links {
    display: flex;
    gap: 24px; /* Changed from 1.5rem to pixels */
    align-items: center;
}

.footer-social-links a,
.footer-social-links a i {
    color: #fff !important;
    font-size: 24px; /* Changed from 1.5rem to pixels */
    transition: color 0.3s;
    text-decoration: none;
}

.footer-social-links a:hover,
.footer-social-links a:hover i {
    color: #007bff !important;
}

.footer-text {
    text-align: center;
    line-height: 1.4;
}

.footer-text p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    color: #ccc !important;
}
/* === END: FOOTER === */


/* === START: MOBILE RESPONSIVE STYLES === */
@media (max-width: 768px) {
    /* --- General Mobile Layout --- */
    header { padding: 1rem; }
    footer { flex-direction: column; gap: 1.5rem; }
    .books-container { flex-direction: column; align-items: center; }

    /* --- Hamburger & Mobile Nav --- */
    .nav-links { display: none; }
    .hamburger { display: block; font-size: 2rem; background: none; border: none; cursor: pointer; color: #fff !important; }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: #000;
        width: 100%;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
        padding: 0.5rem 0;
    }

    .nav-links.active li { width: 100%; margin: 0; text-align: center; }
    .nav-links.active a { padding: 0.75rem 1rem; display: block; -webkit-tap-highlight-color: transparent; }

    /* --- START: NEW, CORRECTED FIX FOR MOBILE FLASHING --- */
    /*
     * This specifically targets the "Projects" and "Books" links.
     * It tells them to have NO background color when tapped (:active).
    */
    .nav-links.active > li > a:not(.dropbtn):active {
        background-color: transparent;
    }

    /*
     * This specifically targets the "About Me" and "Files" buttons.
     * It forces them to KEEP their white background when tapped.
    */
    .nav-links.active > li > a.dropbtn:active {
        background-color: #fff;
    }
    /* --- END: NEW, CORRECTED FIX FOR MOBILE FLASHING --- */

    /* --- Mobile Accordion Menu --- */
    /*
     * This rule is more specific and comes after, so it correctly
     * ensures the dropdown buttons ("About Me", "Files")
     * KEEP their white background.
    */
    .nav-links.active .dropbtn {
        display: inline-block;
        background-color: #fff;
        color: #000;
        padding: 5px 15px;
        border-radius: 6px;
    }
    
    .nav-links.active .dropbtn .fa-caret-down {
        display: inline-block;
        color: #000;
        margin-left: 5px;
    }

    .nav-links.active .dropdown-content {
        display: none;
        position: static;
        background-color: transparent;
        box-shadow: none;
        width: 100%;
    }

    .nav-links.active .dropdown-content.open { display: block; }

    /* This rule makes the sub-menu links visible again */
    .nav-links.active .dropdown-content a {
        background-color: rgba(255, 255, 255, 0.1);
        padding-left: 0; /* Change from 2rem to 0 */
        text-align: center; /* Add this line */
        font-size: 0.9rem;
        color: #fff !important; /* Fixes invisible text */
    }

    /* --- Mobile Profile Picture --- */
    .profile-picture {
        float: none;
        display: block;
        margin: 0 auto 2rem auto;
    }

    /* This rule restores the 2x2 grid for your contact buttons */
    .icon-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}
/* === END: MOBILE RESPONSIVE STYLES === */

/* === START: NEW LANDING PAGE STYLES === */
.landing-main {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 2rem;
}

.landing-container {
    max-width: 600px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2.5rem 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.landing-container h2 {
    margin-bottom: 0.5rem;
    color: #004080;
}

.landing-container p {
    margin-bottom: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.landing-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.landing-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    background-color: #6c757d; /* Changed to Gray */
    color: #fff !important;
}

.landing-btn:hover {
    background-color: #5a6268; /* Darker Gray on hover */
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.landing-btn i {
    font-size: 1.5rem;
}

.landing-footer-nav {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.landing-footer-nav a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.landing-footer-nav a:hover {
    text-decoration: underline;
}

.landing-footer-nav span {
    margin: 0 0.5rem;
    color: #ccc;
}
/* === END: NEW LANDING PAGE STYLES === */

/* === ACTIVE LINK STYLING === */
/* For regular navigation links (Projects, Books) */
.nav-links a.active-link:not(.dropbtn) {
    background-color: #fff !important;
    color: #000 !important;
    border-radius: 4px !important;
}

/* For dropdown buttons (About Me, Files) - keep them white when active */
.dropbtn.active-link {
    background-color: #fff !important;
    color: #000 !important;
    border-radius: 4px !important;
}

/* Ensure the caret icon is also black when active */
.dropbtn.active-link .fa-caret-down {
    color: #000 !important;
}

/* Ensure hover states work correctly */
.dropbtn.active-link:hover {
    background-color: #fff !important;
    color: #000 !important;
}

/* === START: RESPONSIVE DESIGN (MEDIA QUERIES) === */

/* Change the max-width from pixels to ems for better zoom responsiveness */
/* 768px is typically 48em (768 / 16) */
@media (max-width: 48em) {
    /* REPLACE the old header block with this corrected version */
    header {
        padding: 1rem;
        /* These properties ensure the title and hamburger stay on the same line */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    /* This styles the title for mobile view to allow wrapping */
    header h1 {
        font-size: 1.1rem; /* Smaller font for mobile */
        line-height: 1.3;  /* Adjust line height for wrapping */
        margin-right: 1rem; /* Add some space between title and hamburger */
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #000;
        display: none;
        padding: 0.5rem 0;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .nav-links a {
        padding: 0.75rem 1rem;
        display: block;
    }

    .hamburger {
        display: block;
        font-size: 2rem;
        background: none;
        border: none;
        cursor: pointer;
        color: #fff !important;
    }

    /* --- About Me & Files Dropdowns --- */
    .nav-links .dropdown-content {
        position: static;
        background-color: transparent;
        box-shadow: none;
        width: 100%;
        display: none;
    }

    .nav-links .dropdown-content.open {
        display: block;
    }

    .nav-links .dropdown-content a {
        padding: 0.75rem 1rem;
        text-align: center;
        font-size: 0.9rem;
        color: #fff !important;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-links .dropdown-content a:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    /* --- Profile Picture & Icon Buttons --- */
    .profile-picture {
        float: none;
        display: block;
        margin: 0 auto 2rem auto;
    }

    .icon-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}
/* === END: RESPONSIVE DESIGN (MEDIA QUERIES) === */

/* === START: INLINE LINK STYLING === */
.inline-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.inline-link:hover {
    color: #0056b3;
    border-bottom: 1px solid #0056b3;
    text-decoration: none;
}
/* === END: INLINE LINK STYLING === */