/* ========================================
   Newburgh FOIL Records - Main Stylesheet
   A clean, professional design for legal transparency
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;
    --accent-color: #c53030;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #ffffff;
    --bg-light: #f7fafc;
    --bg-dark: #edf2f7;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --max-width: 1200px;
    --header-height: 70px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-dark);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

.section--light {
    background-color: var(--bg-light);
}

.section--dark {
    background-color: var(--primary-dark);
    color: white;
}

/* Header */
.header {
    background-color: var(--primary-dark);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.header__logo:hover {
    color: white;
    opacity: 0.9;
}

.header__logo-icon {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav__list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav__link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav__link:hover,
.nav__link--active {
    color: white;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.2s ease;
}

.nav__link:hover::after,
.nav__link--active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 2.75rem;
    margin-bottom: 1rem;
}

.hero__subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn--primary {
    background-color: var(--accent-color);
    color: white;
}

.btn--primary:hover {
    background-color: #9b2c2c;
    color: white;
}

.btn--secondary {
    background-color: white;
    color: var(--primary-dark);
}

.btn--secondary:hover {
    background-color: var(--bg-light);
    color: var(--primary-dark);
}

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn--outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card__icon {
    width: 50px;
    height: 50px;
    background-color: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.card__title {
    margin-bottom: 0.5rem;
}

.card__text {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    text-align: center;
    padding: 3rem 0;
}

.stat__number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat__label {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Records Library Page */
.records-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 3rem 0;
}

.records-header h1 {
    color: white;
    margin-bottom: 0.5rem;
}

.records-header p {
    opacity: 0.9;
}

/* Search & Filters */
.filters {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-top: -2rem;
    position: relative;
    z-index: 10;
}

.filters__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.filter-group input::placeholder {
    color: var(--text-light);
}

.filters__actions {
    display: flex;
    gap: 0.5rem;
}

.btn--filter {
    padding: 0.75rem 1.5rem;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    color: var(--text-light);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.sort-controls select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Record Cards */
.records-grid {
    display: grid;
    gap: 1rem;
}

.record-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.record-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.record-card__icon {
    width: 50px;
    height: 60px;
    background-color: var(--accent-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
}

.record-card__content {
    min-width: 0;
}

.record-card__title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.record-card__title a {
    color: inherit;
}

.record-card__title a:hover {
    color: var(--primary-light);
}

.record-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.record-card__meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.record-card__description {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

.record-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-light);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.tag--department {
    background-color: #ebf8ff;
    color: #2b6cb0;
}

.tag--type {
    background-color: #faf5ff;
    color: #6b46c1;
}

.record-card__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn--download {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination__btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination__btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination__btn--active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.no-results__icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* About Page */
.about-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.about-hero h1 {
    color: white;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h2 {
    margin-top: 2rem;
}

.about-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-info {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.contact-info h3 {
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-item__icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer__section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer__section p,
.footer__section a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer__section a:hover {
    color: white;
}

.footer__links {
    list-style: none;
}

.footer__links li {
    margin-bottom: 0.5rem;
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .header__inner {
        padding: 0 1rem;
    }

    .nav__toggle {
        display: block;
    }

    .nav__list {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: var(--shadow-lg);
    }

    .nav__list--open {
        display: flex;
    }

    .nav__link {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav__link::after {
        display: none;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1.1rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .filters__row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .record-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .record-card__icon {
        width: 40px;
        height: 50px;
    }

    .record-card__actions {
        flex-direction: row;
        width: 100%;
    }

    .record-card__actions .btn {
        flex: 1;
    }

    .results-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer__inner {
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .container {
        padding: 0 1rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat__number {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .filters,
    .pagination,
    .record-card__actions {
        display: none;
    }

    .record-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}
