/* ===== Imports ===== */
@import url('./variables.css');

/* ===== Reset ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    height: 100%;
}

body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* ===== Animated Background ===== */
.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0.06;
    animation: float 20s ease-in-out infinite;
}
.shape-1 { top: 10%; left: 5%; animation-delay: 0s; animation-duration: 25s; }
.shape-2 { top: 20%; right: 10%; animation-delay: -5s; animation-duration: 22s; }
.shape-3 { top: 60%; left: 15%; animation-delay: -10s; animation-duration: 28s; }
.shape-4 { top: 40%; right: 20%; animation-delay: -7s; animation-duration: 20s; }
.shape-5 { top: 80%; left: 50%; animation-delay: -3s; animation-duration: 24s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -50px) rotate(90deg); }
    50% { transform: translate(-20px, -100px) rotate(180deg); }
    75% { transform: translate(50px, -50px) rotate(270deg); }
}

/* ===== Navbar ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-icon { font-size: 1.5rem; }

.nav-logo {
    height: 2rem;
    width: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.theme-toggle-icon {
    color: var(--primary-light);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem 3rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

/* Compact (post-upload) hero — strip all padding so breadcrumb sits ~10px below navbar */
.hero-compact {
    padding: 0;
    flex: 0;
    min-height: 0;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(244, 114, 182, 0.1);
    border: 1px solid rgba(244, 114, 182, 0.2);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.2rem;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--accent), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.7;
}

/* ===== Upload Area ===== */
.upload-section { margin-bottom: 3rem; }

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}
.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(244,114,182,0.05));
    opacity: 0;
    transition: var(--transition);
}
.upload-area:hover { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.upload-area:hover::before { opacity: 1; }
.upload-area.drag-over {
    border-color: var(--accent);
    background: rgba(244, 114, 182, 0.05);
    transform: scale(1.01);
}
.upload-area.uploading { pointer-events: none; }

.upload-content { position: relative; z-index: 1; }

.upload-icon {
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.upload-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== Features Grid ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; }

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== Results Section ===== */
.results {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 2rem 3rem;
}

.results-with-margins {
    margin: 0 10%;
    max-width: none;
}

.results-wide.results-with-margins {
    max-width: none;
}

.folder-summary-page {
    margin-right: 5%;
}

.results-header { margin-bottom: 2rem; }

.results-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.results-actions { display: flex; gap: 0.75rem; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-on-primary);
    box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--primary); }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-glow); }

.stat-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.2rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: var(--shadow-glow); }

.search-bar svg { color: var(--text-dim); flex-shrink: 0; }

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}
.search-input::placeholder { color: var(--text-dim); }

.folder-controls {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
}
.btn-link:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* ===== AI Options Bar ===== */
.ai-options-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    margin: 1rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.ai-option-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.ai-option-label:hover {
    color: var(--text);
}

.ai-option-label input[type='checkbox'] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ===== Folder Cards ===== */
.folders-container { display: flex; flex-direction: column; gap: 0.5rem; }

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.pagination-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-button:disabled:hover {
    color: var(--primary-light);
    background: transparent;
}

.pagination-status {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.folder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}
.folder-card:hover { border-color: rgba(99, 102, 241, 0.3); }

/* ===== Depth-based folder color coding ===== */

/* Depth 0 — root folders: indigo/primary accent */
.folder-depth-0 {
    border-left: 3px solid var(--primary);
}
.folder-depth-0 .folder-icon-fa   { color: var(--primary-light); }
.folder-depth-0 .folder-badge     { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }

/* Depth 1 — first-level subfolders: teal/cyan */
.folder-depth-1 {
    border-left: 3px solid #2dd4bf;
}
.folder-depth-1 .folder-icon-fa   { color: #2dd4bf; }
.folder-depth-1 .folder-badge     { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }

/* Depth 2+ — deeper subfolders: amber/warm */
.folder-depth-2 {
    border-left: 3px solid #f59e0b;
}
.folder-depth-2 .folder-icon-fa   { color: #f59e0b; }
.folder-depth-2 .folder-badge     { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Badge variants by depth (also used when isAi=false) */
.folder-badge-depth-0 { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.folder-badge-depth-1 { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }
.folder-badge-depth-2 { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Indentation spacer for subfolders */
.folder-depth-indent {
    display: inline-block;
    flex-shrink: 0;
}

/* Folder name group — stacks parent path above leaf name */
.folder-name-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Parent path breadcrumb shown above the leaf name */
.folder-parent-path {
    font-size: 0.68rem;
    color: var(--text-dim);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Light theme depth overrides */
:root[data-theme='light'] .folder-depth-0 { border-left-color: var(--primary-dark); }
:root[data-theme='light'] .folder-depth-1 { border-left-color: #0d9488; }
:root[data-theme='light'] .folder-depth-2 { border-left-color: #d97706; }

.folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}
.folder-header:hover { background: var(--bg-card-hover); }

.folder-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.folder-chevron {
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: transform 0.2s ease;
}
.folder-chevron.expanded { transform: rotate(90deg); }

.folder-icon { font-size: 1.1rem; }

.folder-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.folder-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.2rem 0.3rem;
    border-radius: var(--radius-sm);
    opacity: 0.55;
    transition: var(--transition);
    line-height: 1;
}
.btn-icon:hover { opacity: 1; background: var(--icon-hover-bg); }
.btn-icon-danger:hover { background: rgba(239, 68, 68, 0.15); }

.folder-edit-input {
    background: var(--bg-surface);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    outline: none;
    width: 180px;
    font-family: inherit;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.folder-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.folder-bookmarks {
    padding: 0.25rem 0.75rem 0.75rem;
    border-top: 1px solid var(--border);
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}
.bookmark-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.bookmark-favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.bookmark-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bookmark-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-url {
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-external {
    color: var(--text-dim);
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
}
.bookmark-item:hover .bookmark-external { opacity: 1; }

/* ===== Folder Tree (profile page) ===== */
.ftree-root, .ftree-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    cursor: default;
    transition: background 0.15s;
}
.ftree-root:hover, .ftree-child:hover { background: var(--bg-card-hover); }

.ftree-root { font-weight: 600; }
.ftree-child { color: var(--text-muted); }

/* depth 0: indigo */
.ftree-depth-0 { color: var(--primary-light); }
.ftree-depth-0 .fa-solid { color: var(--primary-light); }
/* depth 1: teal */
.ftree-depth-1 { color: #2dd4bf; }
.ftree-depth-1 .fa-solid { color: #2dd4bf; }
/* depth 2+: amber */
.ftree-depth-2, .ftree-depth-3 { color: #f59e0b; }
.ftree-depth-2 .fa-solid, .ftree-depth-3 .fa-solid { color: #f59e0b; }

.ftree-badge {
    margin-left: auto;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.ftree-depth-1 .ftree-badge { background: rgba(45, 212, 191, 0.12); color: #2dd4bf; }
.ftree-depth-2 .ftree-badge, .ftree-depth-3 .ftree-badge { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

/* ===== Transitions ===== */
.slide-enter-active, .slide-leave-active {
    transition: all 0.25s ease;
    overflow: hidden;
}
.slide-enter-from, .slide-leave-to {
    max-height: 0;
    opacity: 0;
}
.slide-enter-to, .slide-leave-from {
    max-height: 2000px;
    opacity: 1;
}

/* ===== Main Content Area (grows to push footer down) ===== */
.results, .hero {
    flex: 1;
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 1;
    text-align: right;
    padding: 0.5rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.72rem;
    line-height: 1.2;
    margin-top: auto;
}

.footer strong { color: var(--text-muted); }

.footer-sub {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ===== Release Distribution ===== */
.results-wide {
    max-width: 1200px;
}

.release-distribution {
    max-width: 1040px;
}

.release-distribution-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.release-distribution-badge {
    width: fit-content;
    margin-bottom: 0;
}

.release-distribution-title-row {
    align-items: flex-start;
    margin-bottom: 0;
}

.release-distribution-copy {
    max-width: 640px;
}

.release-distribution-subtitle {
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
}

.release-distribution-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.release-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.release-summary-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.release-summary-pill strong {
    font-size: 1rem;
    color: var(--text);
}

.release-summary-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 700;
}

.release-status-panel,
.release-empty-state {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text-muted);
}

.release-status-panel i,
.release-empty-state i {
    color: var(--primary-light);
    font-size: 1.15rem;
}

.release-status-panel-error {
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.release-status-panel-error i {
    color: #f87171;
}

.release-status-panel p,
.release-empty-state p {
    margin-top: 0.35rem;
    color: inherit;
    line-height: 1.5;
}

.release-empty-state {
    flex-direction: column;
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.release-empty-state h3 {
    font-size: 1.05rem;
    color: var(--text);
}

.release-grid {
    display: grid;
    gap: 1rem;
}

.release-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow);
}

.release-card-latest {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08), var(--shadow);
}

.release-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.release-card-topline {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.release-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.release-version {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 0.92rem;
}

.release-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.release-description {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.65;
    margin-bottom: 0.95rem;
}

.release-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    color: var(--text-dim);
    font-size: 0.78rem;
}

.release-metadata span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .results-title-row { flex-direction: column; align-items: flex-start; }
    .navbar { padding: 0.75rem 1rem; }
    .nav-links { gap: 0.75rem; }
    .search-bar { flex-wrap: wrap; }
    .folder-controls { width: 100%; justify-content: flex-end; }
    .release-summary-bar { grid-template-columns: 1fr; }
    .release-card-header { flex-direction: column; align-items: flex-start; }
    .release-distribution-actions { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .hero { padding: 2rem 1rem; }
    .results { padding: 1.5rem 1rem; }
    .hero-title { font-size: 1.8rem; }
    .pagination-bar { flex-wrap: wrap; }
    .release-distribution-actions .btn,
    .release-card .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== AI Overlay & Animations ===== */
.ai-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ai-bg-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.ai-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.5rem;
    opacity: 0.4;
    animation: orbitParticle 8s linear infinite;
    transform-origin: 0 0;
    animation-delay: var(--delay, 0s);
}

@keyframes orbitParticle {
    0% {
        transform: rotate(var(--angle, 0deg)) translateX(var(--radius, 40vmin)) scale(0.8);
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
        transform: rotate(calc(var(--angle, 0deg) + 180deg)) translateX(var(--radius, 40vmin)) scale(1.1);
    }
    100% {
        transform: rotate(calc(var(--angle, 0deg) + 360deg)) translateX(var(--radius, 40vmin)) scale(0.8);
        opacity: 0.2;
    }
}

.ai-modal {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 80px rgba(99, 102, 241, 0.2), 0 0 160px rgba(244, 114, 182, 0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.ai-brain-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-brain-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: rotateRing 3s linear infinite;
}

.ring-1 {
    width: 100px; height: 100px;
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    animation-duration: 2s;
}
.ring-2 {
    width: 76px; height: 76px;
    border-bottom-color: var(--accent);
    border-left-color: var(--accent);
    animation-duration: 1.5s;
    animation-direction: reverse;
}
.ring-3 {
    width: 54px; height: 54px;
    border-top-color: #c084fc;
    border-right-color: #c084fc;
    animation-duration: 1s;
}

@keyframes rotateRing {
    to { transform: rotate(360deg); }
}

.ai-brain-core {
    font-size: 2rem;
    animation: pulseBrain 1s ease-in-out infinite alternate;
    position: relative;
    z-index: 1;
}

@keyframes pulseBrain {
    from { transform: scale(0.9); filter: brightness(0.9); }
    to { transform: scale(1.1); filter: brightness(1.2); }
}

.ai-title {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.ai-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.ai-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.5s ease;
    animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.ai-progress-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.ai-status-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    min-height: 1.4em;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: blink 1s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

.ai-categories-stream {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

.ai-category-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: chipAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.ai-chip-0 { background: rgba(99,102,241,0.2); color: var(--primary-light); }
.ai-chip-1 { background: rgba(244,114,182,0.2); color: var(--accent); }
.ai-chip-2 { background: rgba(192,132,252,0.2); color: #c084fc; }
.ai-chip-3 { background: rgba(34,197,94,0.2); color: var(--success); }
.ai-chip-4 { background: rgba(245,158,11,0.2); color: var(--warning); }

.ai-chip-count {
    background: rgba(255,255,255,0.15);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.7rem;
}

@keyframes chipAppear {
    from { transform: scale(0) rotate(-10deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ===== Categorize Options Modal ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.modal-dialog {
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), var(--shadow-glow);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.bc-item {
    font-size: 0.92rem;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.bc-item:hover { color: var(--primary-light); }

.bc-sep {
    font-size: 0.92rem;
    color: var(--text-dim);
    opacity: 0.5;
    user-select: none;
}

.bc-current {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== Dashboard ===== */
.dashboard {
    position: relative;
    z-index: 1;
    max-width: none;
    margin: 0 5%;
    padding: 3rem 0;
    flex: 1;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 1rem 0 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.dashboard-card,
.action-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
}
.dashboard-card:hover,
.action-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}
.dashboard-card-muted { opacity: 0.75; }
.dashboard-card-muted:hover { opacity: 1; }
.action-card-muted { opacity: 0.75; }
.action-card-muted:hover { opacity: 1; }

.dc-icon {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dc-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.dc-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.dc-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-top: 0.5rem;
}

/* ===== Wizard Action Groups ===== */
.wizard-action-groups {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ===== Wizard Toolbar (unified button + options panel) ===== */
.wizard-toolbar-wrap {
    margin-bottom: 1.5rem;
}

.wizard-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    width: 100%;
}

.wizard-toolbar-divider {
    width: 1px;
    height: 1.4rem;
    background: var(--border);
    margin: 0 0.4rem;
    align-self: center;
    flex-shrink: 0;
}

.wizard-toolbar-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0.25rem;
}

.wizard-save-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
    font-family: inherit;
}
.wizard-save-lg:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45); }
.wizard-save-lg:active { transform: translateY(0); }
.wizard-save-lg:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.wizard-action-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.wizard-group-primary {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.wizard-group-secondary {
    padding: 0;
    border-left: none;
}

.wizard-group-secondary::before,
.wizard-group-danger::before {
    content: '|';
    margin: 0 0.5rem;
    color: var(--text-muted);
    user-select: none;
}

.wizard-group-save {
    padding: 0;
    margin-left: auto;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4); }
.btn-success:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.wizard-option-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.wizard-option-pill input[type='checkbox'] {
    display: none;
}
.wizard-option-pill:hover {
    border-color: var(--primary);
    color: var(--text);
    background: var(--bg-card-hover);
}
.wizard-option-pill.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light);
    color: var(--primary-light);
}
.wizard-option-pill i { opacity: 0.8; }

.wizard-save-message {
    color: #4ade80;
    font-size: 0.82rem;
    text-align: right;
    padding: 0.2rem 0;
    margin-bottom: 0.4rem;
}

/* ===== Saved Bookmarks Page ===== */
.saved-bm-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.saved-bm-stat {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.saved-bm-stat strong { color: var(--text); }

.saved-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.saved-category-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.1rem;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
}
.saved-category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.scc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scc-icon {
    font-size: 1.3rem;
    color: var(--primary-light);
}

.scc-count {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.scc-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.scc-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: auto;
}
.saved-category-card:hover .scc-link { color: var(--primary-light); }

/* ===== Folder Summary / Shared state panels ===== */
.auth-required-panel,
.loading-panel,
.error-panel,
.empty-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 1rem;
}
.auth-required-panel i,
.loading-panel i,
.error-panel i,
.empty-panel i { font-size: 1.8rem; color: var(--primary-light); }
.error-panel i { color: #f87171; }
.auth-required-panel h3,
.empty-panel h3 { font-size: 1.05rem; color: var(--text); }
.auth-required-panel p,
.empty-panel p,
.loading-panel { font-size: 0.9rem; }
.empty-panel a { color: var(--primary-light); }

/* ===== Search Scope Toggle ===== */
.search-scope-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.search-scope-check input[type='checkbox'] {
    accent-color: var(--primary);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

/* ===== Saved Bookmark Category Expander ===== */
.saved-cat-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}
.saved-cat-section:hover { border-color: rgba(99, 102, 241, 0.3); }

.saved-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.75rem;
}
.saved-cat-header:hover { background: var(--bg-card-hover); }

.saved-cat-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.saved-cat-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-cat-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.saved-cat-explore {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-light);
    text-decoration: none;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.07);
    transition: var(--transition);
    white-space: nowrap;
}
.saved-cat-explore:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--primary-light);
}

.saved-cat-bookmarks {
    padding: 0.25rem 0.75rem 0.75rem;
    border-top: 1px solid var(--border);
}

/* ===== Folder Category Edit (Folder Summary) ===== */
.folder-cat-edit-input {
    background: var(--bg-surface);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    outline: none;
    width: 200px;
    font-family: inherit;
}

/* ===== Bookmark Edit Row (Folder Summary) ===== */
.bm-edit-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    min-width: 0;
}

.bm-edit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    flex: 1;
    min-width: 0;
}

.bm-edit-input {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    font-family: inherit;
    outline: none;
}

.bm-edit-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

/* ===== Responsive additions ===== */
@media (max-width: 768px) {
    .dashboard-title { font-size: 1.9rem; }
    .saved-categories-grid { grid-template-columns: 1fr 1fr; }
    .wizard-group-primary { gap: 0.4rem; }
    .breadcrumb { justify-content: flex-start; }
    .footer { text-align: left; padding: 0.5rem 1rem; }
}

@media (max-width: 640px) {
    .dashboard-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .dashboard-cards { grid-template-columns: 1fr; }
    .saved-categories-grid { grid-template-columns: 1fr; }
    .wizard-action-group { flex-wrap: wrap; }
}

.option-group {
    margin-bottom: 1rem;
}

.option-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-surface);
}

.option-label:hover {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
}

.option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.option-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.option-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: var(--bg-surface);
}

.modal-footer .btn {
    padding: 0.75rem 1.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-cancel-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1.2rem;
}

/* ===== AI Results ===== */
.ai-result-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(244,114,182,0.1));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.ai-result-icon {
    font-size: 2.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(10deg) scale(1.1); }
    75% { transform: rotate(-10deg) scale(1.1); }
}

.ai-result-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-result-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.ai-folder-card {
    animation: cardSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardSlideIn {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.ai-card-0 .folder-header:hover { background: rgba(99,102,241,0.08); }
.ai-card-1 .folder-header:hover { background: rgba(244,114,182,0.08); }
.ai-card-2 .folder-header:hover { background: rgba(192,132,252,0.08); }
.ai-card-3 .folder-header:hover { background: rgba(34,197,94,0.08); }
.ai-card-4 .folder-header:hover { background: rgba(245,158,11,0.08); }

.ai-badge {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(244,114,182,0.2));
    color: var(--primary-light);
}

/* ===== AI Organize Button ===== */
.btn-ai {
    background: linear-gradient(135deg, #6366f1, #a855f7, #f472b6);
    color: white;
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
    position: relative;
    overflow: hidden;
}
.btn-ai::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.btn-ai:hover::before { transform: translateX(100%); }
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
.btn-ai:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ai-icon {
    animation: spinSlow 3s linear infinite;
    display: inline-block;
}

@keyframes spinSlow {
    0%, 80%, 100% { transform: rotate(0deg); }
    90% { transform: rotate(360deg); }
}

.ai-not-configured {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-dim);
    border: 1px dashed var(--border);
    cursor: help;
}

.folder-icon-fa {
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-right: 0.5rem;
}

.search-highlight {
    background-color: #facc15;
    color: #1a1a1a;
    border-radius: 2px;
    padding: 0 2px;
    font-style: normal;
}

/* ===== Bookmark Tooltip ===== */
.bookmark-item[title] {
    position: relative;
}

.bookmark-tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text);
    white-space: normal;
    max-width: 300px;
    box-shadow: var(--shadow-glow);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.bookmark-item:hover .bookmark-tooltip {
    opacity: 1;
}

/* ===== Expand/Collapse All Buttons ===== */
.bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.bulk-actions .btn-link {
    font-size: 0.85rem;
}
