/* Question Papers Repository Styles */

.qp-repository-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Search Bar Styles */
.qp-search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.qp-search-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.qp-search-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Loading State */
.qp-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* Repository Content */
.qp-repository-content {
    min-height: 200px;
}

/* Folder Structure Styles */
.qp-folder-structure {
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* Folder Items */
.qp-folder-item {
    margin-bottom: 10px;
}

.qp-folder-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qp-folder-header:hover {
    background: #e8e8e8;
    transform: translateX(5px);
}

.qp-folder-header.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.qp-folder-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Folder Icons */
.qp-folder-icon.year-folder::before {
    content: "📁";
    font-size: 20px;
}

.qp-folder-icon.term-folder::before {
    content: "📂";
    font-size: 20px;
}

.qp-folder-icon.class-folder::before {
    content: "📚";
    font-size: 20px;
}

.qp-folder-icon.pdf-file::before {
    content: "📄";
    font-size: 20px;
}

.qp-folder-name {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
}

.qp-folder-count {
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.qp-folder-header.active .qp-folder-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Folder Content */
.qp-folder-content {
    padding-left: 40px;
    margin-top: 10px;
    display: none;
}

.qp-folder-content.open {
    display: block;
    animation: slideDown 0.3s ease;
}

/* Papers List */
.qp-papers-list {
    margin-top: 10px;
}

.qp-paper-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.qp-paper-item:hover {
    background: #f0f0f0;
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qp-paper-title {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.qp-paper-subject {
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    margin: 0 10px;
}

.qp-paper-size {
    font-size: 12px;
    color: #666;
    margin-right: 15px;
}

.qp-download-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s ease;
}

.qp-download-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.qp-download-btn::before {
    content: "⬇";
    margin-right: 5px;
}

/* Empty State */
.qp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.qp-empty-state::before {
    content: "📭";
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .qp-search-bar {
        flex-direction: column;
    }
    
    .qp-search-bar input[type="text"],
    .qp-search-bar select {
        width: 100%;
    }
    
    .qp-folder-content {
        padding-left: 20px;
    }
    
    .qp-paper-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .qp-paper-subject,
    .qp-paper-size {
        margin: 5px 0;
    }
    
    .qp-download-btn {
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
}

/* List Layout */
.qp-repository-container[data-layout="list"] .qp-folder-structure {
    padding: 0;
    border: none;
}

.qp-repository-container[data-layout="list"] .qp-folder-header {
    display: none;
}

.qp-repository-container[data-layout="list"] .qp-folder-content {
    display: block !important;
    padding-left: 0;
}

/* Grid Layout */
.qp-repository-container[data-layout="grid"] .qp-papers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.qp-repository-container[data-layout="grid"] .qp-paper-item {
    flex-direction: column;
    padding: 20px;
    text-align: center;
}

/* Breadcrumb Navigation */
.qp-breadcrumb {
    display: flex;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.qp-breadcrumb-item {
    cursor: pointer;
    color: #007cba;
    text-decoration: none;
}

.qp-breadcrumb-item:hover {
    text-decoration: underline;
}

.qp-breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

/* Loading Spinner */
.qp-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}/* Search Results Styles */
.qp-search-results {
    padding: 20px 0;
}

.qp-search-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    padding: 10px;
    background: #f0f8ff;
    border-left: 4px solid #007cba;
}

.qp-search-result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: box-shadow 0.2s ease;
}

.qp-search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qp-search-result-item .qp-folder-icon {
    flex-shrink: 0;
    margin-right: 15px;
    font-size: 20px;
    color: #dc3545;
}

.qp-paper-details {
    flex: 1;
    min-width: 0;
}

.qp-paper-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
}

.qp-paper-title mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
}

.qp-paper-meta {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

.qp-paper-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.qp-paper-size {
    font-size: 12px;
    color: #888;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 3px;
}

.qp-download-btn {
    padding: 8px 16px;
    background: #007cba;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.qp-download-btn:hover {
    background: #005a87;
    color: white !important;
}

.qp-search-actions {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.qp-back-to-browse {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.qp-back-to-browse:hover {
    background: #5a6268;
}

.qp-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 6px;
}

.qp-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .qp-search-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .qp-paper-actions {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .qp-search-result-item .qp-folder-icon {
        margin-right: 10px;
    }
}