@import url('fonts.css');

/* =========================
   Accessibility Utilities
   ========================= */

/* Skip link - visible only on focus */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--color-sunny-yellow);
    outline-offset: 2px;
}

/* Screen reader only - visually hidden but accessible to assistive tech */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Global focus styles */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Remove default outline only when we have focus-visible */
:focus:not(:focus-visible) {
    outline: none;
}

:root {
    /* Typography - using system font stack */
    --font-display: var(--font-system, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    --font-body: var(--font-system, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    
    /* Primary Colors */
    --color-midnight-blue: #0d2031;
    --color-misty-gray: #eceef0;
    --color-accent: #0099da;
    --color-white: #ffffff;
    
    /* Secondary Colors */
    --color-dark-blue: #0c62ad;
    --color-cobalt-blue: #0099da;
    --color-sky-blue: #d4edfc;
    --color-stone-gray: #6b7b7e;
    --color-forest-green: #2caa57;
    --color-sunny-yellow: #ffe700;
    
    /* Theme-specific variables (light mode defaults) */
    --bg-primary: var(--color-misty-gray);
    --bg-secondary: var(--color-white);
    --bg-tertiary: #f5f5f5;
    --text-primary: var(--color-midnight-blue);
    --text-secondary: #4a5568;
    --text-muted: var(--color-stone-gray);
    --border-color: #d0d5dd;
    --shadow-color: rgba(13, 32, 49, 0.1);
    --shadow-heavy: rgba(13, 32, 49, 0.25);
}

/* Dark mode - using Midnight Blue as the base */
[data-theme="dark"] {
    --bg-primary: var(--color-midnight-blue);
    --bg-secondary: #162638;
    --bg-tertiary: #1e3448;
    --text-primary: var(--color-misty-gray);
    --text-secondary: #b8c4ce;
    --text-muted: #8fa3a8;
    --border-color: #2a4258;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .site-logo {
    filter: brightness(1.2);
}

[data-theme="dark"] header {
    background: #091620;
}

[data-theme="dark"] .sidebar {
    background: var(--bg-secondary);
    border-right-color: var(--border-color);
}

[data-theme="dark"] .content {
    background: var(--bg-primary);
}

[data-theme="dark"] .download-item,
[data-theme="dark"] .stats,
[data-theme="dark"] .filter-bar {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .download-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .download-name {
    color: var(--text-primary);
}

[data-theme="dark"] .download-meta,
[data-theme="dark"] .download-path {
    color: var(--text-secondary);
}

[data-theme="dark"] .breadcrumb-separator,
[data-theme="dark"] .breadcrumbs span {
    color: var(--text-secondary);
}

[data-theme="dark"] .breadcrumbs a {
    color: var(--color-accent);
}

[data-theme="dark"] select,
[data-theme="dark"] #searchInput {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-content label:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .folder-item,
[data-theme="dark"] .favorite-item {
    color: var(--text-primary);
}

[data-theme="dark"] .folder-item:hover,
[data-theme="dark"] .favorite-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .folder-item:focus,
[data-theme="dark"] .favorite-item:focus {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .filter-section h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .favorite-label {
    color: var(--text-muted);
}

[data-theme="dark"] .file-type-count {
    color: var(--text-muted);
}

[data-theme="dark"] .breadcrumb:not(:last-child)::after {
    color: var(--text-muted);
}

[data-theme="dark"] .loading,
[data-theme="dark"] .no-results {
    color: var(--text-muted);
}

[data-theme="dark"] .container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .pagination-controls span {
    color: var(--text-primary);
}

[data-theme="dark"] .pagination-controls button:disabled {
    background: #1e3448;
    color: var(--color-stone-gray);
}

[data-theme="dark"] .last-updated {
    color: var(--text-secondary);
}

[data-theme="dark"] .filter-bar label {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .filter-bar select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .home-link-section h3 {
    color: var(--text-primary);
}

/* Material Design SVG Icons */
.icon-home,
.icon-folder,
.icon-pin,
.icon-pin-add,
.icon-search,
.icon-edit,
.icon-copy,
.icon-save,
.icon-file-small,
.icon-folder-small,
.icon-size,
.icon-date,
.icon-star,
.icon-sun,
.icon-moon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230d2031'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

.icon-folder {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230099da'%3E%3Cpath d='M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}

.icon-folder-small {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'%3E%3Cpath d='M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}

.icon-file-small {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E");
}

.icon-pin {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230099da'%3E%3Cpath d='M17 4v7l2 3v2h-6v5l-1 1-1-1v-5H5v-2l2-3V4c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2zM9 4v7.75L7.5 14h9L15 11.75V4H9z'/%3E%3C/svg%3E");
}

.icon-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230099da'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

.icon-edit {
    width: 0.85em;
    height: 0.85em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
}

.icon-copy {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230099DA'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
}

/* Copy icon inside button - inherit button's text color */
.copy-link-button .icon-copy {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230099DA'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
}

.copy-link-button:hover .icon-copy {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
}

.icon-save {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230099DA'%3E%3Cpath d='M17 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z'/%3E%3C/svg%3E");
}

/* Solid filled pin icon for 'Pin current view' button */
.icon-pin-add {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230099da'%3E%3Cpath d='M17 4v7l2 3v2h-6v5l-1 1-1-1v-5H5v-2l2-3V4c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2z'/%3E%3C/svg%3E");
}

.icon-size {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-7-2h2V7h-4v2h2z'/%3E%3C/svg%3E");
}

.icon-date {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM9 10H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm-8 4H7v2h2v-2zm4 0h-2v2h2v-2z'/%3E%3C/svg%3E");
}

.icon-star {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5a623'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

/* Sun icon - material design style with rays */
.icon-sun {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z'/%3E%3C/svg%3E");
}

/* Moon icon - crescent moon material design style */
.icon-moon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z'/%3E%3C/svg%3E");
}

/* Dark mode icon adjustments */
[data-theme="dark"] .icon-home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23eceef0'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .icon-edit {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b8c4ce'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .icon-size {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b8c4ce'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-7-2h2V7h-4v2h2z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .icon-date {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b8c4ce'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM9 10H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm-8 4H7v2h2v-2zm4 0h-2v2h2v-2z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .icon-file-small,
[data-theme="dark"] .icon-folder-small {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b8c4ce'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .icon-folder-small {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b8c4ce'%3E%3Cpath d='M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}

.folder-icon .icon-folder {
    width: 1.2em;
    height: 1.2em;
}

[data-theme="dark"] .dropdown-checkbox span {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-checkbox:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .dropdown-buttons {
    border-color: var(--border-color);
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

/* Headings and labels use display font (Bricolage Grotesque) */
h1, h2, h3, h4, h5, h6,
.filter-bar label,
.stats,
.breadcrumb,
.pagination-controls span,
.modal-content h2 {
    font-family: var(--font-display);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: var(--color-midnight-blue);
    color: var(--color-white);
    padding: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-brand h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    height: 40px;
    width: auto;
}

header h1 {
    font-size: 2em;
    font-weight: 500;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Theme Toggle Switch - Material Design Style */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 32px;
    background: #f5deb3;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    box-shadow: 0 0 0 2px var(--color-accent);
}

.toggle-icon {
    position: absolute;
    z-index: 2;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-icon .icon-sun,
.toggle-icon .icon-moon {
    width: 18px;
    height: 18px;
}

.sun-icon {
    left: 7px;
    opacity: 1;
}

.sun-icon .icon-sun {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z'/%3E%3C/svg%3E");
}

.moon-icon {
    right: 7px;
    opacity: 0.4;
}

.moon-icon .icon-moon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a68a5b'%3E%3Cpath d='M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z'/%3E%3C/svg%3E");
}

.toggle-slider {
    position: absolute;
    width: 26px;
    height: 26px;
    background: #f5a623;
    border-radius: 50%;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Dark mode toggle */
[data-theme="dark"] .theme-toggle {
    background: #1e3a5f;
}

[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 0 0 0 2px var(--color-accent);
}

[data-theme="dark"] .toggle-slider {
    left: calc(100% - 29px);
    background: var(--color-accent);
}

[data-theme="dark"] .sun-icon {
    opacity: 0.4;
}

[data-theme="dark"] .sun-icon .icon-sun {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234a6a8a'%3E%3Cpath d='M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
}

[data-theme="dark"] .moon-icon .icon-moon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z'/%3E%3C/svg%3E");
}

/* Help Button */
.help-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--color-white);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.help-button:hover {
    border-color: var(--color-accent);
    background: rgba(0, 153, 218, 0.2);
    color: var(--color-accent);
}

[data-theme="dark"] .help-button {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .help-button:hover {
    border-color: var(--color-accent);
    background: rgba(0, 153, 218, 0.2);
}

/* Settings Button */
.settings-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.settings-button:hover {
    border-color: var(--color-accent);
    background: rgba(0, 153, 218, 0.2);
}

.settings-button .icon-settings {
    width: 18px;
    height: 18px;
    display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

[data-theme="dark"] .settings-button {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .settings-button:hover {
    border-color: var(--color-accent);
    background: rgba(0, 153, 218, 0.2);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-right: 30px;
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
}

.modal-content p:last-of-type {
    margin-bottom: 0;
}

.modal-content h3 {
    color: var(--text-primary);
    font-size: 1.1em;
    margin: 20px 0 12px 0;
}

.modal-content ul {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.modal-content li {
    margin-bottom: 6px;
}

.modal-disclaimer {
    font-size: 0.85em;
    opacity: 0.7;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Help Modal Styles */
.help-modal {
    max-width: 480px;
    display: flex;
    flex-direction: column;
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.help-header h2 {
    margin: 0;
    padding: 0;
}

.help-logo {
    height: 36px;
    width: auto;
}

.help-intro {
    text-align: center;
    margin-bottom: 25px;
}

.help-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.help-footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

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

.help-footer svg {
    width: 18px;
    height: 18px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.feature-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.feature-card strong {
    color: var(--text-primary);
    font-size: 1em;
}

.feature-card span:last-child {
    color: var(--text-secondary);
    font-size: 0.85em;
    line-height: 1.4;
}

.feature-card code {
    background: var(--bg-secondary);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--color-accent);
}

.modal-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: var(--color-accent);
}

/* Help Modal Tabs */
.help-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.help-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: -2px;
}

.help-tab:hover {
    color: var(--color-accent);
}

.help-tab:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 153, 218, 0.3);
    border-radius: 4px 4px 0 0;
}

.help-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.help-tab-panels {
    display: grid;
    flex: 1;
}

.help-tab-content {
    grid-area: 1 / 1;
    visibility: hidden;
}

.help-tab-content.active {
    visibility: visible;
}

/* Keyboard Shortcuts Styles */
.keyboard-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.shortcut-group h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 14px;
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 0 var(--border-color);
    min-width: 24px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

/* User Favorites / Pin styles */
.user-favorite {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 8px !important;
}

.user-favorite-name {
    flex: 1;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 4px;
}

.user-favorite-name:focus {
    box-shadow: 0 0 0 2px var(--color-accent);
}

.user-favorite-edit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 4px;
}

.user-favorite:hover .user-favorite-edit {
    opacity: 0.7;
}

.user-favorite-edit:hover {
    opacity: 1 !important;
    background: var(--bg-tertiary);
}

.add-pin-item {
    color: var(--text-muted) !important;
    font-style: italic;
    font-size: 13px;
}

.add-pin-item:hover {
    color: var(--color-accent) !important;
}

/* Pin Modal */
.pin-modal {
    max-width: 400px;
}

.pin-type-indicator {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    word-break: break-all;
}

.pin-form {
    margin-bottom: 20px;
}

.pin-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.pin-form input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.pin-form input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.2);
}

.pin-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pin-modal-actions-right {
    display: flex;
    gap: 10px;
}

.pin-save-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.pin-save-btn:hover {
    background: #007ab8;
}

.pin-cancel-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.pin-cancel-btn:hover {
    background: var(--border-color);
}

.pin-delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.pin-delete-btn:hover {
    background: #c82333;
}

/* Settings Modal */
.settings-modal {
    max-width: 500px;
}

.settings-modal h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-modal h2 .icon-settings {
    width: 24px;
    height: 24px;
    display: inline-block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230d2031'%3E%3Cpath d='M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

[data-theme="dark"] .settings-modal h2 .icon-settings {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E");
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.settings-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.settings-form {
    margin-bottom: 16px;
}

.settings-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.settings-form input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.settings-form input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.2);
    outline: none;
}

.settings-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.settings-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.settings-status.loading {
    background: rgba(0, 153, 218, 0.1);
    color: var(--color-accent);
}

.settings-status.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.settings-status.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.settings-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.settings-load-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.settings-load-btn:hover {
    background: #007ab8;
}

.settings-load-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.settings-reset-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.settings-reset-btn:hover {
    background: var(--border-color);
}

.settings-info {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    line-height: 1.5;
}

.settings-info strong {
    color: var(--text-primary);
}

.search-bar {
    position: relative;
    display: flex;
    gap: 0;
    flex: 1;
}

#searchInput {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: margin-right 0.3s ease;
    margin-right: 0;
}

#searchInput:focus {
    box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.3), 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-bar.has-text #searchInput {
    margin-right: 10px;
}

#clearSearch {
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease;
    opacity: 0;
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.search-bar.has-text #clearSearch {
    opacity: 1;
    width: 40px;
    padding: 0;
}

#clearSearch:hover {
    background: #007ab8;
    transform: scale(1.05);
}

.main-content {
    display: flex;
    min-height: 600px;
}

.sidebar {
    width: 300px;
    background: var(--color-white);
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    /* Viewport minus header (~130px) and body padding (2×20px + buffer) */
    max-height: calc(100vh - 180px);
    scrollbar-gutter: stable;
}

/* Hide scrollbar when not needed, show on hover/scroll */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

.sidebar:hover::-webkit-scrollbar-thumb,
.sidebar:focus-within::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section h3 {
    margin-bottom: 15px;
    color: var(--color-midnight-blue);
    font-size: 1.1em;
    font-weight: 600;
}

.file-type-filter {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.file-type-filter:hover {
    background: #e3f2fd;
}

.file-type-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.file-type-filter input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.file-type-count {
    margin-left: auto;
    font-size: 0.9em;
    color: #666;
}

.file-type-filter.active .file-type-count {
    color: white;
}

.folder-tree {
    font-size: 0.95em;
}

.folder-item {
    padding: 8px 12px;
    margin-bottom: 4px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    user-select: none;
}

.folder-item:hover {
    background: #e3f2fd;
}

.folder-item:focus {
    background: #e3f2fd;
    box-shadow: 0 0 0 2px var(--color-accent);
}

.folder-item.active {
    background: var(--color-accent);
    color: var(--color-white);
    font-weight: 600;
}

.folder-item.collapsed .folder-children {
    display: none;
}

.folder-children {
    margin-left: 20px;
    margin-top: 4px;
}

.folder-toggle {
    display: inline-block;
    width: 16px;
    font-size: 12px;
}

.favorite-label {
    padding: 8px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.favorite-label:first-child {
    margin-top: 0;
}

.favorite-item {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--color-midnight-blue);
}

.favorite-item:hover {
    background: #fff3e0;
    color: #f57c00;
}

.favorite-item:focus {
    background: #fff3e0;
    color: #f57c00;
    box-shadow: 0 0 0 2px var(--color-accent);
}

.favorite-item.active {
    background: #fff3e0;
    color: #f57c00;
    font-weight: 600;
}

.filter-section + .filter-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.home-link-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.home-link-section h3 {
    transition: all 0.2s;
    border-radius: 4px;
    padding-left: 0;
    padding-right: 0;
}

.home-link-section h3:hover {
    background: var(--color-accent);
    color: white;
    padding-left: 10px;
}

.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.filter-bar {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-bar label {
    font-weight: 600;
    color: var(--color-midnight-blue);
    white-space: nowrap;
}

.filter-bar select {
    flex: 1;
    max-width: 300px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-dropdown {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.dropdown-btn {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    text-align: left;
}

.dropdown-btn:hover {
    border-color: var(--color-accent);
}

.dropdown-btn:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.2);
}

.dropdown-arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.2s;
}

.dropdown-btn:hover .dropdown-arrow {
    color: var(--color-accent);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.dropdown-content.show {
    display: block;
}

.dropdown-buttons {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-action-btn {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background: var(--color-white);
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-action-btn:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

.dropdown-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.dropdown-checkbox:hover {
    background: #f8f9fa;
}

.dropdown-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
}

.dropdown-checkbox span {
    font-size: 14px;
    color: var(--color-midnight-blue);
}

.dropdown-checkbox input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--color-accent);
}

.filter-bar select:hover {
    border-color: var(--color-accent);
}

.filter-bar select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.2);
}

.stats {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-white);
    border-radius: 8px;
    color: var(--color-midnight-blue);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.last-updated {
    font-weight: 400;
    font-size: 0.85em;
    color: #666;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

#paginationBottom {
    justify-content: flex-end;
}

.pagination-controls button {
    padding: 8px 16px;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.pagination-controls button:hover:not(:disabled) {
    background: #007ab8;
    transform: scale(1.05);
}

.pagination-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-controls span {
    font-weight: 600;
    color: #333;
}

.breadcrumbs {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.breadcrumb {
    color: var(--color-accent);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.breadcrumb:hover {
    background: var(--color-misty-gray);
}

.breadcrumb:focus {
    background: var(--color-misty-gray);
    box-shadow: 0 0 0 2px var(--color-accent);
}

.breadcrumb:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: #666;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
    gap: 12px;
}

.download-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--color-accent);
}

.download-item:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.3);
}

.download-item-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.download-icon {
    font-size: 2em;
    margin-right: 20px;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-icon svg {
    width: 32px;
    height: 32px;
}

.download-info {
    flex: 1;
    min-width: 0;
}

.download-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
    flex-wrap: wrap;
}

.download-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 1.05em;
}

.download-path {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 6px;
    font-style: italic;
}

.download-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.download-button {
    padding: 10px 20px;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.download-button:hover {
    background: #007ab8;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 153, 218, 0.4);
}

.download-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.folder-item-display {
    padding: 16px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: row !important;
    align-items: center;
    text-align: left;
}

.folder-item-display:hover {
    background: var(--color-misty-gray);
    border-color: var(--color-accent);
    transform: translateX(5px);
}

.folder-item-display:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.3);
    outline: none;
}

.folder-icon {
    font-size: 1.5em;
    margin-right: 15px;
    flex-shrink: 0;
}

.folder-item-display .download-info {
    flex: 1;
    min-width: 0;
}

.folder-item-display .download-name {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.loading, .no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1em;
}

.no-results {
    display: none;
}

/* Copy link button */
.copy-link-button {
    padding: 8px 12px;
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
    margin-right: 10px;
}

.copy-link-button:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

.copy-link-button.copied {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 24px;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: #007ab8;
    transform: scale(1.05);
}

.sidebar-toggle .close-icon {
    display: none;
}

.sidebar-toggle.active .hamburger-icon {
    display: none;
}

.sidebar-toggle.active .close-icon {
    display: inline;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #007ab8;
    transform: translateY(-3px);
}

/* Mobile-friendly toast notification */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-midnight-blue);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 2000;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Tablet styles */
@media (max-width: 1024px) {
    .filter-bar {
        flex-wrap: wrap;
    }
    
    .filter-bar label {
        flex-basis: auto;
    }
    
    .custom-dropdown,
    .filter-bar select {
        flex: 1;
        min-width: 150px;
        max-width: none;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        padding: 0;
        overflow: auto; /* Re-enable scrolling on mobile */
    }
    
    .container {
        border-radius: 0;
        box-shadow: none;
    }
    
    header {
        padding: 15px;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .header-controls {
        gap: 10px;
    }

    .theme-toggle {
        width: 52px;
        height: 28px;
        border-radius: 14px;
    }

    .toggle-slider {
        width: 22px;
        height: 22px;
    }

    [data-theme="dark"] .toggle-slider {
        left: calc(100% - 25px);
    }

    .toggle-icon .icon-sun,
    .toggle-icon .icon-moon {
        width: 14px;
        height: 14px;
    }

    .sun-icon {
        left: 5px;
    }

    .moon-icon {
        right: 5px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    .header-brand {
        gap: 10px;
    }
    
    .header-brand h1 {
        display: none;
    }
    
    .header-top {
        margin-bottom: 15px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .site-logo {
        height: 32px;
    }
    
    #searchInput {
        padding: 14px 18px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .main-content {
        flex-direction: column;
        min-height: auto;
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        border-right: none;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
        transition: left 0.3s ease;
        padding-top: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Always show scrollbar on mobile for better UX */
    .sidebar::-webkit-scrollbar-thumb {
        background: var(--border-color);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .content {
        padding: 15px;
        max-height: none;
        overflow-y: visible;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .filter-bar label {
        width: 100%;
        margin-bottom: -5px;
    }
    
    .custom-dropdown,
    .filter-bar select {
        width: 100%;
        max-width: none;
    }
    
    .dropdown-btn,
    .filter-bar select {
        padding: 12px 15px;
    }
    
    .stats {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 12px;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pagination-controls button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Hide first/last buttons on mobile for cleaner UI */
    #firstPage, #lastPage, #firstPageBottom, #lastPageBottom {
        display: none;
    }
    
    /* Add bottom padding to prevent hamburger menu overlap */
    #paginationBottom {
        padding-bottom: 80px;
    }
    
    .breadcrumbs {
        margin-bottom: 15px;
        gap: 4px;
    }
    
    .breadcrumb {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .download-item {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        text-align: left;
    }
    
    .download-icon {
        margin-right: 0;
        margin-bottom: 10px;
        font-size: 1.5em;
        text-align: left;
        justify-content: flex-start;
    }
    
    .download-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .download-info {
        margin-bottom: 12px;
    }
    
    .download-name {
        font-size: 0.95em;
        word-break: break-word;
    }
    
    .download-path {
        font-size: 0.8em;
    }
    
    .download-meta {
        font-size: 0.85em;
        gap: 10px;
    }
    
    .download-actions {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    
    .copy-link-button {
        flex: 1;
        text-align: center;
        margin-right: 0;
    }
    
    .download-button {
        flex: 1;
        text-align: center;
        padding: 12px 16px;
    }
    
    .folder-item-display {
        padding: 14px 16px;
        flex-direction: row !important;
        align-items: center;
    }
    
    .folder-item-display .download-info {
        margin-bottom: 0;
    }
    
    .folder-icon {
        font-size: 1.3em;
        margin-right: 12px;
    }
    
    /* Improve touch targets in sidebar */
    .folder-item {
        padding: 12px 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .favorite-item {
        padding: 14px 15px;
        min-height: 44px;
    }
    
    .home-link-section h3 {
        padding: 14px 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Toast position adjustment for mobile */
    .toast {
        bottom: 100px;
        left: 15px;
        right: 15px;
        transform: none;
        text-align: center;
    }
    
    @keyframes toastIn {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    @keyframes toastOut {
        from { opacity: 1; transform: translateY(0); }
        to { opacity: 0; transform: translateY(20px); }
    }
}

/* Small mobile */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.2em;
    }
    
    .site-logo {
        height: 28px;
    }
    
    .download-meta {
        flex-direction: column;
        gap: 6px;
    }
    
    .pagination-controls button {
        padding: 10px;
        font-size: 12px;
    }
    
    .pagination-controls span {
        font-size: 13px;
    }
}
