/* Browse Page Styles */

/* ════════════ GLOBAL / UTILITY CLASSES ════════════ */
.bg-noise {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 50;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.glass-panel {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-panel-hover {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-panel-hover:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.search-bar-glow:focus-within {
    box-shadow: 0 0 40px -10px color-mix(in srgb, var(--primary-color) 40%, transparent);
}
.search-bar-glow:focus-within input {
    border-color: color-mix(in srgb, var(--primary-color) 50%, transparent);
}

/* ════════════ PAGE SPECIFIC CLASSES ════════════ *//* Filter Chips */
.filter-chip {
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-chip.active {
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 30%, transparent);
    color: #fff;
}

/* Filter Selects */
.filter-select {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-select:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-color) 30%, transparent), 0 4px 12px rgba(0,0,0,0.1);
}

.filter-select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* Material Card */
.material-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top-color: rgba(255, 255, 255, 0.12);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); /* Inner Top highlight */
}

.material-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 60%, transparent));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.material-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.material-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 15px var(--primary-color);
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.notes {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.category-badge.pyqs {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-badge.assignments {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.category-badge.books {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.category-badge.presentations {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.category-badge.other {
    background: rgba(148, 163, 177, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 177, 0.3);
}

/* Rating Stars */
.rating-stars {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.rating-stars .star {
    color: #fbbf24;
    font-size: 14px;
}

.rating-stars .star.empty {
    color: rgba(251, 191, 36, 0.3);
}

/* Stats Row */
.stats-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #64748b;
    font-size: 12px;
}

.stats-row .stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stats-row .stat .material-symbols-outlined {
    font-size: 14px;
}

/* Branch Tag */
.branch-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

/* Preview Modal */
#preview-modal {
    opacity: 0;
    transition: opacity 0.3s;
}

#preview-modal:not(.hidden) {
    opacity: 1;
}

#preview-container canvas {
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 0.5rem;
}

/* Rating Modal */
#rating-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#rating-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.rating-modal-content {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 440px;
    width: 90%;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rating-modal-header {
    margin-bottom: 1.5rem;
}

.rating-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-modal-header h3 .material-symbols-outlined {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Star Rating Input */
.rating-input {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.star-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: rgba(251, 191, 36, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-btn:hover {
    color: rgba(251, 191, 36, 0.8);
    transform: scale(1.1);
}

.star-btn.active {
    color: #fbbf24;
    transform: scale(1.2);
}

/* Comment Textarea */
.rating-comment {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.rating-comment:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.rating-comment::placeholder {
    color: #64748b;
}

/* Modal Actions */
.rating-modal-actions {
    display: flex;
    gap: 1rem;
}

.rating-modal-actions button {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rating-modal-actions .btn-submit {
    background: var(--primary-color);
    color: #0f172a;
}

.rating-modal-actions .btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.rating-modal-actions .btn-submit:active {
    transform: translateY(0);
}

.rating-modal-actions .btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rating-modal-actions .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Recommendations Section */
#recommendations-section {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#recommendations-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
}

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

.recommendation-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top-color: rgba(255, 255, 255, 0.12);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.recommendation-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.recommendation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 60%, transparent));
    opacity: 0;
    transition: opacity 0.3s;
}

.recommendation-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.recommendation-card:hover::before {
    opacity: 1;
}

.recommendation-badge {
    display: inline-block;
    background: rgba(79, 172, 254, 0.2);
    border: 1px solid rgba(79, 172, 254, 0.4);
    color: #4faafe;
    padding: 0.375rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-bottom: 0.75rem;
}

.recommendation-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0.5rem 0;
    flex-grow: 1;
}

.recommendation-meta {
    color: #64748b;
    font-size: 12px;
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.recommendation-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.recommendation-badge-category {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.recommendation-badge-category.notes {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.recommendation-badge-category.pyqs {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.recommendation-badge-category.assignments {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.recommendation-badge-category.books {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.recommendation-badge-category.presentations {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.recommendation-badge-category.other {
    background: rgba(148, 163, 177, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 177, 0.3);
}

.recommendation-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.recommendation-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.recommendation-rating .star {
    color: #fbbf24;
    font-size: 14px;
}

.recommendation-stats {
    display: flex;
    gap: 0.5rem;
    font-size: 12px;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-chip {
        padding: 0.375rem 0.75rem;
        font-size: 12px;
    }

    #materials-grid {
        grid-template-columns: 1fr;
    }

    #recommendations-grid {
        grid-template-columns: 1fr;
    }

    .rating-modal-content {
        padding: 1.5rem;
    }

    .rating-input button {
        font-size: 2rem;
    }
}
