/* Global Reset & Base Styles */
:root {
    --primary-color: #2E7D32;
    /* Fresh Leaf Green */
    --primary-light: #4CAF50;
    /* Light Green */
    --primary-dark: #1B5E20;
    /* Deep Forest Green */
    --accent-color: #F9A825;
    /* Sunny Yellow/Gold */
    --text-main: #1C1C1E;
    /* Soft Black */
    --text-muted: #52606D;
    /* Slate Gray */
    --bg-color: #F4F7F4;
    /* Very subtle Mint/Gray tint */
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow-sm: 0 2px 4px rgba(46, 125, 50, 0.05);
    /* Tinted shadow */
    --shadow-md: 0 4px 12px rgba(46, 125, 50, 0.08);
    --shadow-lg: 0 12px 24px rgba(46, 125, 50, 0.12);
    --radius-md: 8px;
    --radius-lg: 16px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
    /* Desktop background image */
    background-image: url('desktop.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Switch to mobile background on small screens */
@media (max-width: 768px) {
    body {
        background-image: url('mobile.png');
        background-attachment: scroll;
        /* Fixed doesn't work well on mobile browsers */
    }
}

/* Foundation Header */
.foundation-header {
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 32px;
    border-bottom: 4px solid #F9A825;
    /* Accent border matching foundation colors */
}

.foundation-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.foundation-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    /* Space between ambedkar.jpeg and AU logo */
}

.foundation-logo {
    height: 90px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Slightly smaller for the AU logo if needed */
.au-right-logo {
    height: 85px;
}

.foundation-center {
    flex: 1;
    text-align: center;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.foundation-title {
    font-size: 2.2rem;
    /* Significantly larger */
    font-weight: 900;
    color: #1A237E;
    /* Deep Blue (mixed blue/black look) */
    margin: 0;
    line-height: 1.1;
    text-transform: uppercase;
    font-family: 'Times New Roman', Times, serif;
    letter-spacing: 0.5px;
    width: 100%;
}

.foundation-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #000000;
    /* Black */
    margin: 8px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.foundation-chair {
    font-size: 1.4rem;
    /* Bigger than subtitle (0.9rem), slightly smaller than title (2.2rem) */
    font-weight: 800;
    color: #1A237E;
    /* Same Mixed Blue/Black theme */
    margin: 6px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Times New Roman', Times, serif;
}

/* Sub Header Static Text */
.sub-header {
    background-color: #E8F5E9;
    /* Very light green */
    color: var(--primary-dark);
    height: 2rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 0px 20px;
    border-bottom: 1px solid rgba(46, 125, 50, 0.2);
    font-family: 'Times New Roman', Times, serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive adjustments for Foundation Header */
@media (max-width: 1024px) {
    .foundation-title {
        font-size: 1.8rem;
    }

    .foundation-chair {
        font-size: 1.2rem;
    }

    .foundation-logo {
        height: 70px;
    }
}

@media (max-width: 768px) {
    .foundation-header {
        padding: 8px 16px;
        /* Keep row layout as requested, just shrink */
        flex-direction: row;
        gap: 8px;
    }

    .foundation-logo {
        height: 50px;
    }

    .au-right-logo {
        height: 45px;
    }

    .foundation-right {
        gap: 6px;
    }

    .foundation-title {
        font-size: 1.2rem;
        /* Much smaller title */
        line-height: 1.1;
    }

    .foundation-subtitle {
        font-size: 0.7rem;
        margin-top: 2px;
    }

    .foundation-chair {
        font-size: 0.85rem;
        margin-top: 2px;
    }

    .sub-header {
        font-size: 1.1rem;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .foundation-header {
        padding: 6px 8px;
    }

    .foundation-logo {
        height: 36px;
    }

    .au-right-logo {
        height: 32px;
    }

    .foundation-right {
        gap: 4px;
    }

    .foundation-title {
        font-size: 0.9rem;
    }

    .foundation-subtitle,
    .foundation-chair {
        font-size: 0.6rem;
        display: block;
        /* Ensure they break lines if needed */
    }

    .sub-header {
        font-size: 0.9rem;
    }
}

/* Header / App Bar */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    /* Reduced from 70px */
    padding: 0 24px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(46, 125, 50, 0.1);
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    overflow: hidden;
    border-radius: 50%;
}

.nav-logo-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.025em;
}

/* Ticker Styles */
.ticker-wrap {
    width: 100%;
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 1.0rem;
    /* Standard readable size */
    font-weight: 600;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 40;
}

.ticker {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 15s linear infinite;
    /* Faster scroll */
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    letter-spacing: 0.5px;
}

@keyframes ticker-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* Response Ticker adjustments */
@media (max-width: 600px) {
    .ticker-wrap {
        font-size: 0.95rem;
        padding: 8px 0;
    }
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 24px;
}

.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 480px;
    background-color: #F3F4F6;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 0 16px;
    transition: all 0.2s ease;
}

.search-container:focus-within {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-icon {
    color: var(--secondary-text);
    margin-right: 8px;
}

#searchInput {
    border: none;
    background: transparent;
    width: 100%;
    padding: 10px 0;
    font-size: 0.95rem;
    color: var(--primary-text);
    outline: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary-text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.au-logo-container {
    height: 40px;
    display: flex;
    align-items: center;
}

.au-logo {
    height: 48px;
    /* Slightly larger overlap */
    width: auto;
    object-fit: contain;
}

.au-fallback {
    display: none;
    font-weight: bold;
    color: #888;
    border: 1px dashed #ccc;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Hamburger Button – hidden on desktop, shown on mobile */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: var(--primary-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover span {
    background-color: var(--primary-color);
}

/* Mobile Dropdown Menu */
.mobile-menu {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 49;
    position: relative;
}

.mobile-menu.hidden {
    display: none;
}

.mobile-nav-link {
    display: block;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s, color 0.2s;
}

.mobile-nav-link:hover {
    background-color: #F0FDF4;
    color: var(--primary-color);
}

/* Show hamburger, hide desktop nav on mobile */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    #desktopNav {
        display: none;
    }
}

/* Dashboard Row: block layout, photo is absolute within section */
.dashboard-row {
    display: block;
}

/* Make home section the positioning parent for the photo */
#home-page {
    position: relative;
}

/* Photo Box — absolute top-right of the home content area (below ticker) */
.photo-box {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    border-radius: 0 0 0 var(--radius-lg);
    /* Bottom-left corner rounded only */
    overflow: hidden;
    box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.18);
    border: 2px solid var(--border-color);
    border-top: none;
    border-right: none;
    background-color: #fff;
    z-index: 10;
}

.photo-box-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* On mobile: fix to bottom-right corner above FAB */
@media (max-width: 640px) {
    .photo-box {
        position: fixed;
        top: auto;
        bottom: 108px;
        /* Sit above FAB */
        right: 0;
        width: 72px;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
        border-top: 2px solid var(--border-color);
        border-right: none;
        z-index: 85;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    }

    .photo-box-img {
        height: 90px;
    }
}

/* Responsive Navbar Adjustments */
@media (max-width: 768px) {
    .app-bar {
        padding: 0 16px;
        height: 60px;
        /* Slight increase for touch targets if needed, or keep compact */
    }

    .brand-name {
        display: none;
        /* Hide brand text on mobile to save space */
    }

    .search-container {
        max-width: 200px;
        /* Shrink search bar */
        margin: 0 12px;
    }

    .nav-links {
        display: none;
        /* Hide nav links on mobile, rely on FAB/main content */
        /* Alternatively, could transform into a hamburger menu, but hiding is simpler for now locally */
    }

    .au-logo-container {
        height: 32px;
        /* Smaller AU logo */
    }

    .au-logo {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .app-bar {
        padding: 0 12px;
    }

    .search-container {
        /* On very small screens, maybe just show icon or very small input */
        max-width: 140px;
    }

    #searchInput {
        font-size: 0.85rem;
    }

    .header-left {
        gap: 8px;
    }
}

/* Main Content Grid */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    padding-bottom: 80px;
    position: relative;
    z-index: 1;
}

.page-section.hidden {
    display: none;
}

.page-section:not(.hidden) {
    animation: fadeIn 0.4s ease-out;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
}

@media (min-width: 640px) {
    .field-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .field-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .field-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Field Card */
.field-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.field-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-image-wrapper {
    height: 200px;
    width: 100%;
    position: relative;
    background-color: #E2E8F0;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.field-card:hover .card-image {
    transform: scale(1.08);
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.field-nickname {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #B0BEC5;
    border-radius: 50%;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: #FFEBEE;
    color: #EF5350;
    transform: rotate(15deg);
}

.field-url-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    background-color: #F1F8E9;
    /* Very light green tint */
    padding: 4px 10px;
    border-radius: 6px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 12px;
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    letter-spacing: -0.02em;
}

.open-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.open-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

/* Floating Action Button (FAB) */
.fab-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 12px 24px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    z-index: 90;
}

.fab-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15), 0 16px 32px rgba(16, 185, 129, 0.5);
}

.fab-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal {
    background-color: white;
    width: 90%;
    max-width: 480px;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: scale(1);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.hidden .modal {
    transform: scale(0.95);
}

.modal h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--primary-text);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-text);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.required {
    color: #EF4444;
    margin-left: 2px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: #F3F4F6;
    color: var(--primary-text);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

/* About Section */
.about-container {
    background: white;
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 900px;
    margin: 0 auto;
}

.about-container h2 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.about-card {
    margin: 32px 0;
    padding: 24px;
    background: #ECFDF5;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.about-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.feature-box {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.feature-box h4 {
    margin-bottom: 8px;
    color: var(--primary-text);
}

.citation {
    margin-top: 40px;
    font-style: italic;
    color: var(--secondary-text);
    text-align: center;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}