/* ========================
   CSS Variables & Reset
   ======================== */
:root {
    --primary: #0d2b5e;
    --primary-light: #1a3f7a;
    --primary-dark: #081d40;
    --accent: #ec3f3b;
    --accent-light: #f06b68;
    --accent-dark: #d42f2b;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-light: #f1f5f9;
    --bg-blue: #eef4ff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================
   HEADER
   ======================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-university {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.logo-repo {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--bg-blue);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ========================
   HERO
   ======================== */
.hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary) 40%, var(--primary-light) 65%, var(--accent-dark) 100%);
    z-index: 0;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 100% 100%, rgba(236,63,59,0.4) 0%, transparent 35%),
        radial-gradient(circle at 20% 80%, rgba(13,43,94,0.3) 0%, transparent 50%);
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 52px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 40px;
    line-height: 1.15;
}

/* Search Box */
.search-box {
    max-width: 680px;
    margin: 0 auto;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.95);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.search-input-wrapper:focus-within {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 12px 16px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--accent-dark);
}

.search-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
    border-color: rgba(255,255,255,0.4);
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    z-index: 1;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* ========================
   SEARCH RESULTS
   ======================== */
.search-results {
    padding: 40px 0 60px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.results-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.results-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.results-count {
    font-size: 14px;
    color: var(--text-light);
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.results-close {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.results-close:hover {
    background: var(--bg);
    color: var(--text);
}

/* Loading Spinner */
.results-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result Items */
.result-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.result-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-light);
    transform: translateY(-1px);
}

.result-item a {
    display: block;
}

.result-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.result-type.item {
    background: #dbeafe;
    color: #1d4ed8;
}

.result-type.collection {
    background: #d1fae5;
    color: #065f46;
}

.result-type.community {
    background: #fef3c7;
    color: #92400e;
}

.result-item-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.result-item-title:hover {
    color: var(--accent);
}

.result-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-light);
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-abstract {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination */
.results-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.page-btn:hover,
.page-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* No results */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.no-results svg {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.no-results h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
}

/* ========================
   BROWSE SECTION
   ======================== */
.browse {
    padding: 80px 0;
    background: var(--bg);
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 40px;
    line-height: 1.2;
}

.browse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.browse-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: var(--transition);
    display: block;
}

.browse-card:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.browse-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    background: var(--bg-blue);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.browse-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.browse-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.browse-card p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

/* ========================
   ABOUT SECTION
   ======================== */
.about {
    padding: 80px 0;
    background: var(--bg-blue);
}

.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 60px;
    align-items: center;
}

.about-desc {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 16px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 12px;
}

.btn-outline:hover {
    background: var(--primary);
    color: #ffffff;
}

.about-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius);
    min-width: 0;
}

.about-img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    min-width: 0;
}

.about-pillars-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.about-colleges {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.about-colleges li {
    position: relative;
    padding: 0.45rem 0 0.45rem 1.5rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.5;
}

.about-colleges li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* ========================
   FEATURES SECTION
   ======================== */
.features {
    padding: 80px 0;
    background: var(--bg);
}

.features-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.features-desc {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 24px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.features-logos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.tech-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.tech-logo:hover {
    background: var(--bg-blue);
    border-color: var(--accent-light);
}

.tech-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tech-icon svg {
    width: 22px;
    height: 22px;
}

.dspace-icon { background: #1a3f7a; color: #fff; }
.solr-icon { background: #d9411e; color: #fff; }
.orcid-icon { background: #a6ce39; color: #fff; }
.oai-icon { background: #6366f1; color: #fff; }
.handle-icon { background: #0ea5e9; color: #fff; }

.tech-logo span {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* ========================
   FOOTER
   ======================== */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 48px 0 0;
}

.footer-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: brightness(10);
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-university {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.footer-tagline {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-nav a {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
}

.footer-nav a:hover {
    color: #ffffff;
}

.footer-contact a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
}

.footer-contact a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 968px) {
    .hero-title {
        font-size: 38px;
    }

    .about-content,
    .features-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        order: -1;
    }

    .browse-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }

    .nav.open {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        min-height: 450px;
        padding: 100px 0 60px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .section-title {
        font-size: 28px;
    }

    .browse-grid {
        grid-template-columns: 1fr;
    }

    .features-logos {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .footer-nav {
        justify-content: center;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-close {
        margin-left: 0;
    }

    .search-filters {
        gap: 6px;
    }

    .filter-btn {
        font-size: 11px;
        padding: 5px 12px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 26px;
    }

    .search-input-wrapper {
        flex-direction: column;
        border-radius: var(--radius);
        padding: 8px;
    }

    .search-input {
        width: 100%;
        text-align: center;
    }

    .search-btn {
        width: 100%;
        border-radius: var(--radius-sm);
    }

    .search-icon {
        display: none;
    }
}
