/* ================================================================
   StudySpider PDF Directory Styles
   ================================================================ */

.pyq-directory-page {
    background: var(--bg-primary);
}

.pyq-main {
    padding-top: 90px;
    min-height: 80vh;
    padding-bottom: 4rem;
}

/* ── Page Header ─────────────────────────────────────────────── */
.pyq-header {
    padding: 2.5rem 0 2rem 0;
}

.pyq-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pyq-header p {
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
}

/* ── Layout ─────────────────────────────────────────────────── */
.pyq-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
}

.sidebar-header.mobile-only {
    display: none;
}


/* ── Sidebar ─────────────────────────────────────────────────── */
.pyq-sidebar {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 1.25rem;
}

.filter-section--exam {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.filter-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

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

.filter-select--exam {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ── Document Grid ───────────────────────────────────────────── */
.pyq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* ── Document Cards ──────────────────────────────────────────── */
.pyq-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pyq-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.09);
    border-color: var(--accent-primary);
}

.card-exam-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
    background: rgba(198, 93, 10, 0.08);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0.25rem 0;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.card-meta-line {
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.doc-type-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: #e8f5e9;
    color: #2e7d32;
}

.badge--answer-key { background: #fff3e0; color: #e65100; }
.badge--solution   { background: #e3f2fd; color: #1565c0; }
.badge--syllabus   { background: #f3e5f5; color: #6a1b9a; }
.badge--study-material { background: #e0f2f1; color: #004d40; }
.badge--mock-test  { background: #fce4ec; color: #880e4f; }

.file-size {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* ── State Screens ───────────────────────────────────────────── */
.pyq-state {
    padding: 1rem 0;
}

.pyq-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pyq-empty-state h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pyq-empty-state p {
    color: var(--text-secondary);
}

.loading-text {
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: 1rem;
}

/* ── Skeleton Loading ────────────────────────────────────────── */
.skeleton-card {
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ── Pagination ──────────────────────────────────────────────── */
.pyq-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-info {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ── Dynamic Filters container ───────────────────────────────── */
.dynamic-filters-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    padding-top: 0.5rem;
}

.breadcrumb a {
    color: var(--accent-primary);
    text-decoration: none;
}

.breadcrumb-separator {
    margin: 0 0.4rem;
}

/* ── Mobile Sidebar Overrides ── */
@media (max-width: 900px) {
    .pyq-layout {
        grid-template-columns: 1fr;
    }
    
    .mobile-filter-toggle {
        display: flex;
    }

    .pyq-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        border-radius: 0 12px 12px 0;
        box-shadow: 4px 0 15px rgba(0,0,0,0.15);
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 1.25rem;
        margin-top: 0;
        border-left: none;
        overflow: visible;
        background: #fff;
    }

    .pyq-sidebar.open {
        left: 0;
    }

    .sidebar-scroll-area {
        height: 100%;
        overflow-y: auto;
        padding-right: 10px;
        padding-bottom: 2rem;
    }

    .sidebar-header.mobile-only {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-header.mobile-only h3 {
        margin: 0;
        font-size: 1.2rem;
        color: var(--text-primary);
    }

    .mobile-filter-close {
        background: rgba(0,0,0,0.05);
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-secondary);
        transition: background 0.2s;
    }
    
    .mobile-filter-close:hover {
        background: rgba(0,0,0,0.1);
    }

    .sidebar-handle {
        position: absolute;
        right: -40px;
        top: 30%;
        width: 40px;
        height: 60px;
        background: #fff;
        border: 1px solid var(--border-color);
        border-left: none;
        border-radius: 0 12px 12px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 4px 0 10px rgba(0,0,0,0.08);
        cursor: pointer;
        z-index: 1001;
        color: var(--accent-primary);
    }
    
    .handle-arrow {
        width: 24px;
        height: 24px;
        transition: transform 0.35s ease;
    }
    
    .pyq-sidebar.open .handle-arrow {
        transform: rotate(180deg);
    }
}
