/**
 * NUSU E-Library Main CSS
 */

:root {
    --nusuColorA: #58588a; /* Primary blue */
    --nusuColorB: #0f138c; /* Secondary blue */
    --nusuColorC: #e87b41; /* Accent orange */
    --nusuColorD: #ffffff; /* White */
    --nusuColorE: #58588a; /* Deep Indigo */
    --nusuColorF: #575789; /* Indigo */
    --nusuColorG: #6f6995; /* Muted Purple */
    --nusuColorH: #9093bc; /* Lavender Gray */
    --nusuColorI: #f9fafc; /* Off-White / Light Gray */
    --nusuColorJ: #8e91b4; /* Soft Grayish Purple */
    --nusuColorK: #ffc72c; /* Bright Yellow */
    --nusuColorL: #ffc72b; /* Golden Yellow */
    --nusuColorM: #fbfbfc; /* Almost White */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Scientific background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.97) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.97) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

main {
    flex: 1;
}

/* Header Styles */
.header-bg {
    /* background-color: var(--nusuColorH); */
    /* background-image: linear-gradient(135deg, var(--nusuColorA), var(--nusuColorB)); */
    position: relative;
    overflow: hidden;
}


.header {
    padding: 1rem 0;
}



/* Navigation Styles */
.main-nav {
    display: flex;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 80%;
    margin: 0 auto;
    background-color: var(--nusuColorE);
}

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

.main-nav li {
    position: relative;
}


.main-nav a {
    display: block;
    color: white;
    padding: 1rem 1.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.main-nav a.active {
    color: var(--nusuColorD);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--nusuColorD);
}

/* Search Form Styles */
.search-form {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--nusuColorC);
    box-shadow: 0 0 0 2px rgba(232, 123, 65, 0.2);
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1rem;
    background-color: var(--nusuColorC);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #d06b37;
}



/* Feature Section Styles */
.feature-section {
    padding: 2rem 1rem;
    border-bottom: 1px solid rgba(6, 20, 121, 0.1);
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-section:last-child {
    border-bottom: none;
}

/* Scientific numbered heading */
.feature-title {
    color: var(--nusuColorE);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--nusuColorC);
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    position: relative;
}

.feature-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -2px;
    width: 10px;
    height: 10px;
    background-color: var(--nusuColorC);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.feature-item {
    border: 2px solid var(--nusuColorE);
    padding: 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background-color: rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--nusuColorE);
}

.feature-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(232, 123, 65, 0.1) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.feature-item:hover {
    transform: translateY(-5px);
    border-color: var(--nusuColorC);
    box-shadow: 0 5px 15px rgba(6, 20, 121, 0.1);
}

.feature-item:hover::after {
    opacity: 1;
}

.feature-icon {
    background-color: var(--nusuColorB);
    color: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    position: relative;
    transition: transform 0.3s;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
}

/* Hero Content Styles */
.hero-content {
    position: relative;
    z-index: 5;
}

.search-container {
    margin-top: 1rem;
    position: relative;
    z-index: 5;
}

.advanced-link {
    color: white;
    text-align: right;
    display: block;
    margin-top: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.advanced-link:hover {
    color: var(--nusuColorC);
}

/* Footer Styles */
.footer {
    background-color: var(--nusuColorE);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--nusuColorC);
}



/* Scientific data visualization elements */
.data-point {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--nusuColorC);
    opacity: 0.5;
    border-radius: 0;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0.5; }
}

/* DNA helix animation in background */
@keyframes dnaRotate {
    0% { transform: rotate(0deg) translateY(0); }
    100% { transform: rotate(360deg) translateY(20px); }
}



/* Fix for search dropdown overflow */
.search-select {
    max-width: 100% !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.search-select option {
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Container adjustments for search form */
.grid-cols-1 > div {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    width: 100%;
}

/* Fix for dropdown container */
form[id="advancedSearchForm"] select,
form[id="normalSearchForm"] select {
    width: 100% !important;
    max-width: 100% !important;
}




/* Set a fixed position for select elements */
select {
    height: 38px;
    position: relative;
    display: block;
}

/* Add space at the bottom of the form */
#advancedSearchForm {
    margin-bottom: 150px;
}

/* Ensure container has proper spacing */
.grid-cols-1 > div {
    margin-bottom: 10px;
}

/* Force dropdown to display at the bottom */
.search-select {
    position: relative !important;
}

/* Add specific styles for Chrome */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select {
        padding-right: 25px;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="12"><path d="M4 8L7 12L10 8" stroke="%23666" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
        background-repeat: no-repeat;
        background-position: right 8px center;
        -webkit-appearance: none;
        appearance: none;
    }
}

/* Ensure container has proper overflow handling */
.overflow-hidden {
    overflow: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Fix for dropdown container in grid */
.grid-cols-1 select,
.grid-cols-2 select {
    width: 100% !important;
    max-width: 100% !important;
}

/* General select styling */
select {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

select option {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .search-box {
        display: flex;
        align-items: center;
    }
    
    .search-input {
        margin-bottom: 0;
        margin-right: 0.5rem;
        flex-grow: 1;
    }
    
    .search-button {
        width: auto;
    }
}
