
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,400;0,700;1,400&family=PT+Serif:wght@700&display=swap');

:root {
    --primary-dark: #0b1640;
    --primary-blue: #1e4d7f;
    --accent-teal: #509ab6;
    --accent-coral: #e06656;
    --bg-cream: #fff0e1;
    --card-bg: #ffffff;
    --text-color: #58595b;
    --text-light: #fff7f0;
    --border-color: #b8c3c9;
    --code-bg: #e8dcd0;
    --shadow: 0 2px 6px rgba(11, 22, 64, 0.1);
    --shadow-lg: 0 4px 12px rgba(11, 22, 64, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Josefin Sans', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

::selection {
    background-color: #82e2f7;
    color: var(--primary-dark);
}

header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: var(--text-light);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(11, 22, 64, 0.15);
}

header h1 {
    font-family: 'PT Serif', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stats {
    opacity: 0.9;
    font-size: 0.95rem;
}

.search-container {
    max-width: 600px;
    margin: -1.5rem auto 1.5rem;
    padding: 0 1rem;
    position: relative;
}

#search {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-family: 'Josefin Sans', system-ui, sans-serif;
    font-size: 1rem;
    border: 2px solid var(--accent-teal);
    border-radius: 6px;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(80, 154, 182, 0.2);
}

#search::placeholder {
    color: var(--border-color);
}

.search-icon {
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

.result-count {
    position: absolute;
    right: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 600;
}

.main-content {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    gap: 1.5rem;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    border-radius: 8px;
    padding: 1rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 1rem;
    box-shadow: var(--shadow-lg);
}

.sidebar h3 {
    font-family: 'PT Serif', Georgia, serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.dir-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dir-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.dir-link:hover {
    background-color: rgba(80, 154, 182, 0.3);
}

.dir-link.active {
    background-color: var(--accent-coral);
    color: var(--text-light);
}

.content {
    flex: 1;
    min-width: 0;
}

.directory-section {
    margin-bottom: 2rem;
}

.dir-header {
    font-family: 'PT Serif', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-light);
    background-color: var(--accent-coral);
    padding: 8px 16px;
    margin-bottom: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(224, 102, 86, 0.15);
}

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

.file-item {
    background: var(--card-bg);
    border-radius: 6px;
    border: 2px solid var(--accent-teal);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(80, 154, 182, 0.4), rgba(255, 255, 255, 0.6), rgba(80, 154, 182, 0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.file-item:hover::before {
    left: 150%;
}

.file-item:hover {
    box-shadow: 0 6px 16px rgba(80, 154, 182, 0.35);
    transform: translateY(-2px);
}

.file-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.file-link:hover {
    color: var(--primary-dark);
}

.file-icon {
    font-size: 1.5rem;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 700;
    word-break: break-word;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    font-size: 0.875rem;
    border-top: 3px solid transparent;
    background-image: linear-gradient(var(--bg-cream), var(--bg-cream)), linear-gradient(90deg, var(--accent-coral), var(--accent-teal));
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

footer a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

footer a:hover {
    color: var(--accent-teal);
    border-bottom-color: var(--accent-teal);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--code-bg);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent-teal);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-blue);
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        position: static;
    }

    .dir-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dir-link {
        padding: 0.375rem 0.625rem;
    }

    .file-grid {
        grid-template-columns: 1fr;
    }

    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }
}
