/* 
   Materials Page Styles
   - Custom Variables
   - Animations
   - Sidebar Filters
   - Material Cards
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #6d28d9;
    --secondary: #3b82f6;
    --secondary-light: #60a5fa;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --card-bg: rgba(15, 23, 42, 0.85);
    --card-border: rgba(139, 92, 246, 0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    --shadow-primary: rgba(139, 92, 246, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #020617 0%, #1e1b4b 40%, #1e293b 70%, #020617 100%);
    background-attachment: fixed;
}

/* Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
    opacity: 0;
}

/* =========================================
   Sidebar Filters
   ========================================= */
aside {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(20px);
    border-right: 1.5px solid rgba(139, 92, 246, 0.2);
}

.filter-header-line {
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
}

/* Category Filter Buttons */
.category-filter {
    position: relative;
    overflow: hidden;
}

.category-filter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.category-filter:hover::before {
    opacity: 1;
}

.category-filter.active .check-icon {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
}

.category-filter.active span:last-child {
    color: #ffffff;
    font-weight: 700;
}

/* Check Icon */
.check-icon {
    transition: all 0.3s;
}

/* Reset Button */
.reset-filters-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 1.5px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s;
}

.reset-filters-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
}

/* =========================================
   Page Header
   ========================================= */
.page-header-gradient {
    background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 40%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientShift 8s ease infinite;
}

/* =========================================
   Material Cards
   ========================================= */
.material-item {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1.5px solid var(--card-border);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.material-item::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #a78bfa, #60a5fa, #22d3ee);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s;
}

.material-item:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 30px 60px rgba(139, 92, 246, 0.5);
}

.material-item:hover::before {
    opacity: 0.3;
}

/* Material Thumbnail */
.material-thumbnail {
    position: relative;
    overflow: hidden;
}

.material-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.6) 70%, rgba(15, 23, 42, 0.95) 100%);
}

/* Badges */
.badge-free {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    backdrop-filter: blur(10px);
}

.badge-pdf {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Category Badge */
.category-badge {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    font-weight: 700;
}

/* Author Avatar */
.author-avatar {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.2));
    color: #a78bfa;
}

/* View Button */
.view-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s;
}

.view-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
}

/* =========================================
   Empty State
   ========================================= */
.empty-state-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* =========================================
   Pagination
   ========================================= */
.pagination-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 1.5px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s;
}

.pagination-btn:hover:not(.active) {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6), 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
    .material-item {
        border-width: 1px;
    }
}

/* Focus States */
*:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: #ffffff;
}