/* ==========================================================================
   CSS VARIABLES & RESET
   ========================================================================== */

/* Theme colors and global settings */
:root {
    /* Brand Colors */
    --primary-color: #1F3A5F;      /* Deep navy for headings and footer */
    --accent-color: #6e9134;       /* Leaf green for links and buttons (WCAG AA compliant) */

    /* Text Colors */
    --text-color: #333333;         /* Main body text - WCAG AA compliant */

    /* Backgrounds */
    --bg-color: #ffffff;           /* Main page background */
    --bg-secondary: #F4F7F6;       /* Subtle tinted grey for alternating sections */
    --bg-hover: #f5f5f5;           /* Hover state backgrounds */

    /* Borders & Dividers */
    --border-light: #eeeeee;       /* Light borders and dividers */
    --border-medium: #cccccc;      /* Medium borders */

    /* Layout */
    --nav-height: 90px;
    --container-padding: 40px;
    --container-padding-mobile: 20px;
    --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Custom text selection highlight color */
::selection {
    background: var(--accent-color);
    color: #fff;
}

/* Remove default margins, paddings, and ensure consistent box-sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base body styles - sticky footer layout */
body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.7;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Remove default link styling, add smooth transitions */
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Remove default list bullets */
ul {
    list-style: none;
}

/* ==========================================================================
   GLOBAL UTILITIES & LAYOUT
   ========================================================================== */

/* Centered container with max-width for readability */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* Default vertical spacing for sections */
section {
    padding: 80px 0;
}

/* Consistent intro section styling across all pages */
#intro {
    padding-top: 80px;
    padding-bottom: 60px;
    text-align: center;
}

/* Main heading style for page sections */
.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
}

/* Section title within intro - no border/padding */
#intro .section-title {
    border: none;
    padding: 0;
}

/* Intro paragraph text styling */
#intro p {
    font-size: 1.25rem;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   SKIP LINK (Accessibility)
   ========================================================================== */

/* Hidden skip link that appears on focus for keyboard users */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 15px;
    z-index: 1001;
    font-weight: 600;
    border-radius: 0 0 4px 0;
    transform: translateY(-100%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */

/* Sticky header that remains at top when scrolling */
header {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-color);
    padding: 0 var(--container-padding);
    position: sticky;
    top: env(safe-area-inset-top, 0);
    z-index: 1000;
    border-top: 5px solid var(--accent-color);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Logo and title container */
.branding {
    display: flex;
    align-items: center;
}

/* Logo link containing image and text */
.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Logo image with bounce hover effect */
.logo-img {
    height: 50px;
    width: auto;
    display: block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-link:hover .logo-img {
    transform: scale(1.15);
}

/* Site title next to logo */
.logo-text {
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: var(--primary-color);
    line-height: 1;
}

/* Horizontal navigation menu */
.nav-links {
    display: flex;
    gap: 35px;
}

/* Navigation link styling with grow effect */
.nav-links a,
.nav-links span.active,
.nav-links .dropdown-toggle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Reset button defaults for dropdown toggle */
.dropdown-toggle {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

/* Active, hover, and focus states */
.nav-links a:hover,
.nav-links a:focus,
.nav-links .dropdown-toggle:hover,
.nav-links .dropdown-toggle:focus,
.nav-links .active {
    color: #4d6623; /* Darker green for WCAG AA contrast on white (~6:1) */
    transform: scale(1.1);
}

/* Visible focus outline for keyboard navigation */
a:focus,
button:focus,
.pub-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Dropdown menu container */
.dropdown {
    position: relative;
}

/* Hidden dropdown menu that appears on hover */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Show dropdown on hover and keyboard focus */
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

/* Dropdown link styling */
.dropdown-menu li a,
.dropdown-menu li span.active {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    font-weight: 600;
    text-align: left;
}

.dropdown-menu li a:hover {
    background: var(--bg-hover);
}

/* Active state for dropdown items */
.dropdown-menu li span.active {
    color: var(--accent-color);
    background: transparent;
}


/* ==========================================================================
   HOME PAGE SECTIONS
   ========================================================================== */

/* Mission & Vision section with alternate background */
#mission-vision,
#contact-content {
    background-color: var(--bg-secondary);
    padding: 80px 0;
}

/* Contact card icon */
.contact-icon {
    margin-bottom: 25px;
}

.contact-icon i {
    font-size: 3.5rem;
    color: var(--accent-color);
}

/* Contact card description */
.contact-description {
    margin-bottom: 30px;
}

/* Wider button variant */
.pub-btn-wide {
    min-width: 200px;
}

/* White card container for mission/vision content */
.mv-card {
    background: var(--bg-color);
    border-radius: 30px;
    padding: 60px var(--container-padding);
    max-width: 900px;
    margin: 0 auto 40px auto;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.mv-card:last-child {
    margin-bottom: 0;
}

.mv-card h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 800;
}

.mv-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 750px;
    margin: 0 auto;
}

/* Values section with alternating image/text layout */
#values {
    background-color: #fff;
    padding: 100px 0;
}

.values-header {
    text-align: center;
    margin-bottom: 80px;
}

.values-header p {
    color: var(--text-color);
}

.values-list {
    display: flex;
    flex-direction: column;
    gap: 80px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Each value row with image and text side-by-side */
.value-row {
    display: flex;
    align-items: center;
    gap: 60px;
}

/* Alternates image position for visual interest */
.value-row:nth-child(even) {
    flex-direction: row-reverse;
}

/* Text content container */
.value-content {
    flex: 1;
}

.value-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 700;
}

/* Placeholder for icons/images */
.value-visual {
    flex: 1;
    height: 300px;
    background-color: #f3f4f6;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-weight: 600;
}

.value-visual i {
    font-size: 3rem;
    color: #ccc;
}

/* News section layout */
#news {
    background-color: var(--bg-secondary);
    padding: 80px 0;
}

.news-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Year dividers */
.news-year {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 40px 0 20px 0;
    border-bottom: 2px solid var(--border-medium);
    padding-bottom: 10px;
}

/* Individual news item card */
.news-item {
    background: var(--bg-color);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

/* Slide effect on hover */
.news-item:hover {
    transform: translateX(5px);
}

.news-heading {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-color);
    margin: 0;
}

/* Links within news items */
.news-item a {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 1px dotted var(--primary-color);
}

.news-item a:hover {
    color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
}

/* Category badge (e.g., "Award", "Grant") */
.news-badge {
    display: inline-block;
    background-color: var(--border-light);
    color: var(--text-color);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
}

/* ==========================================================================
   PEOPLE PAGE
   ========================================================================== */

/* Section grouping (faculty, students, alumni) */
.people-group {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* First people-group needs more top padding after intro */
.people-group:first-of-type {
    padding-top: 80px;
}

/* Last people-group needs more bottom padding */
.people-group:last-of-type {
    padding-bottom: 80px;
}

/* Section headers (e.g., "Faculty", "Current Students") */
.people-header {
    font-size: 1.5rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-medium);
    padding-bottom: 10px;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Circular profile image container */
.profile-img-container {
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background-color: #eee;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Faculty member card layout */
.faculty-card {
    display: flex;
    gap: 50px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* Large profile image for faculty */
.profile-img-container.large {
    width: 160px;
    height: 160px;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.profile-role {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

/* Two-column grid for students */
.student-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 60px;
    row-gap: 50px;
}

/* Student card with image and info */
.student-card {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* Smaller profile image for students */
.profile-img-container.small {
    width: 110px;
    height: 110px;
}

.student-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Degree designation (e.g., "BS CS", "PhD") */
.student-name .degree {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-color);
    margin-left: 5px;
}

/* ==========================================================================
   PUBLICATIONS PAGE
   ========================================================================== */

/* Publications list container - spacing after intro */
.publications-list {
    padding-top: 80px;
    padding-bottom: 80px;
}

/* Year divider headers */
.year-heading {
    font-size: 2rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-light);
    margin-top: 60px;
    margin-bottom: 20px;
    font-weight: 800;
}

.year-heading:first-child {
    margin-top: 0;
}

/* Individual publication entry */
.pub-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 30px;
}

/* Publication text content */
.pub-details {
    flex: 1;
}

/* Publication title */
.pub-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1.4;
    display: block;
}

/* Author names */
.pub-authors {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 6px;
}

/* Conference/venue information */
.pub-venue {
    font-size: 0.9rem;
    color: var(--text-color);
    font-style: italic;
}

/* Special award designation */
.award-text {
    color: #9a5500; /* Darker orange for WCAG AA contrast (~5:1) */
    font-weight: 700;
    margin-left: 10px;
}

/* Button container */
.pub-buttons {
    flex-shrink: 0;
}

/* Consistent button styling across site */
.pub-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 140px;
}

/* Lift effect with color change on hover */
.pub-btn:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

/* Dark footer with brand accent */
footer {
    background-color: var(--primary-color);
    color: #ffffff;
    padding-top: 60px;
    padding-bottom: 0;
    font-size: 0.95rem;
    margin-top: auto;
    border-top: 5px solid var(--accent-color);
}

/* Three-column footer layout */
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 50px;
}

/* Individual footer column */
.footer-col {
    flex: 1;
    min-width: 250px;
}

/* Footer column headings */
.footer-col h2,
.footer-col h3,
.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    display: inline-block;
}

.footer-col p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #e0e0e0;
}

/* Footer links with lift hover effect */
.footer-links a {
    display: block;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* Footer link icons */
.footer-links i {
    margin-right: 8px;
}

/* Copyright bar at bottom */
.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px var(--container-padding);
    font-size: 0.85rem;
    text-align: center;
    color: var(--border-medium);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

/* Styles for tablets and mobile devices */
@media (max-width: 768px) {
    /* Use mobile padding variable */
    :root {
        --container-padding: var(--container-padding-mobile);
    }

    /* Reduce section padding on mobile */
    section {
        padding: 60px 0;
    }

    /* Vertical stacked navigation for mobile */
    header {
        position: relative;
        flex-direction: column;
        height: auto;
        padding: var(--container-padding-mobile);
        gap: 20px;
    }

    .branding {
        width: 100%;
        justify-content: center;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    /* Vertical navigation menu items */
    .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-links > li {
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .nav-links > li:last-child {
        border-bottom: none;
    }

    .nav-links > li > a,
    .nav-links > li > span.active,
    .nav-links > li > .dropdown-toggle {
        display: block;
        padding: 15px var(--container-padding-mobile);
        text-align: center;
        font-size: 0.85rem;
        width: 100%;
        background: transparent;
    }

    /* Dropdown menu - full width on mobile */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: var(--bg-secondary);
        min-width: 100%;
    }

    .dropdown-menu li {
        border-bottom: 1px solid rgba(0,0,0,0.03);
    }

    .dropdown-menu li:last-child {
        border-bottom: none;
    }

    .dropdown-menu li a,
    .dropdown-menu li span.active {
        padding: 12px var(--container-padding-mobile);
        font-size: 0.8rem;
        text-align: center;
    }

    /* Reduce heading sizes for mobile */
    .section-title {
        font-size: 1.75rem;
    }

    /* Reduce card padding on mobile */
    .mv-card {
        padding: 40px var(--container-padding-mobile);
        border-radius: 20px;
    }

    /* Reduce value visual height on mobile */
    .value-visual {
        height: 200px;
    }

    /* Stack value rows vertically */
    .value-row,
    .value-row:nth-child(even) {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    /* Reduce year heading sizes */
    .year-heading,
    .news-year {
        font-size: 1.5rem;
    }

    /* Center faculty cards on mobile */
    .faculty-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Single column student grid */
    .student-grid {
        grid-template-columns: 1fr;
    }

    /* Center student cards */
    .student-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Stack publication items vertically */
    .pub-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    /* Full width buttons on mobile */
    .pub-buttons {
        width: 100%;
    }

    .pub-btn {
        display: block;
        width: 100%;
    }

    /* Center footer content */
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-col {
        min-width: 100%;
    }

    .footer-col h2,
    .footer-col h3,
    .footer-col h4 {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .footer-bottom {
        padding: var(--container-padding-mobile);
    }
}