/* ========================================
           SIDEBAR LAYOUT
        ======================================== */
        .library-main-container {
            padding: 10px 0;
            background-color: #f8f9fa;
            min-height: 80vh;
        }

        .library-layout {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 10px;
            align-items: start;
        }

        /* ========================================
           FILTER SIDEBAR
        ======================================== */
        .filter-sidebar {
            background: white;
            border-radius: 4px;
            padding: 12px;
            position: sticky;
            top: 20px;
            height: fit-content;
            border: 1px solid #e9ecef;
        }

        .filter-header {
            margin-bottom: 10px;
            padding-bottom: 8px;
            border-bottom: 1px solid #e9ecef;
        }

        .filter-header h3 {
            font-size: 1rem;
            color: var(--primary-color);
            margin-bottom: 2px;
            font-weight: 600;
        }

        .filter-header p {
            font-size: 0.75rem;
            color: #6c757d;
            margin: 0;
        }

        .section-title {
            text-align: center;
            margin-bottom: 30px;
        }

        .section-title h2 {
            font-size: 2rem;
            color: var(--primary-color);
            margin-bottom: 8px;
            font-weight: 700;
        }

        .section-title p {
            font-size: 1rem;
            color: #6c757d;
            max-width: 500px;
            margin: 0 auto;
        }

        .modern-filter-form {
            background: transparent;
            border-radius: 0;
            padding: 0;
            box-shadow: none;
            position: relative;
            z-index: 1;
            pointer-events: auto;
        }

        .modern-filter-form * {
            pointer-events: auto;
        }

        .filter-row {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 0;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
        }

        .filter-group label {
            font-weight: 500;
            color: var(--primary-color);
            margin-bottom: 3px;
            font-size: 0.75rem;
        }

        .filter-group input,
        .filter-group select {
            padding: 6px 8px;
            border: 1px solid #e9ecef;
            border-radius: 3px;
            font-size: 0.75rem;
            transition: border-color 0.3s ease;
            background-color: white;
            color: #333;
            width: 100%;
            box-sizing: border-box;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        .filter-group input:focus,
        .filter-group select:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(6, 20, 151, 0.1);
        }

        .filter-group input::placeholder {
            color: #999;
            font-style: italic;
        }

        .filter-group select {
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 16px;
            padding-right: 40px;
        }

        .filter-group button {
            padding: 6px 10px;
            border: none;
            border-radius: 3px;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
            background-color: var(--primary-color);
            color: white;
        }

        .filter-group button:hover {
            background-color: var(--primary-light);
            transform: translateY(-1px);
        }

        /* Ensure form elements are interactive */
        .modern-filter-form input[type="text"],
        .modern-filter-form input[type="search"],
        .modern-filter-form select,
        .modern-filter-form input[type="checkbox"],
        .modern-filter-form button {
            pointer-events: auto !important;
            user-select: text;
            -webkit-user-select: text;
            -moz-user-select: text;
            -ms-user-select: text;
            cursor: pointer;
            position: relative;
            z-index: 1;
        }

        .modern-filter-form input[type="text"]:focus,
        .modern-filter-form input[type="search"]:focus {
            background-color: white;
            border-color: var(--primary-color);
            z-index: 2;
        }

        .modern-filter-form select:focus {
            background-color: white;
            border-color: var(--primary-color);
            z-index: 2;
        }

        .modern-filter-form input[type="checkbox"] {
            cursor: pointer;
            pointer-events: auto !important;
        }

        .modern-filter-form button {
            cursor: pointer !important;
            pointer-events: auto !important;
        }

        .filter-actions {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-top: 10px;
            padding-top: 8px;
            border-top: 1px solid #e9ecef;
        }

        .filter-actions .btn {
            width: 100%;
            justify-content: center;
        }

        /* ========================================
           RESOURCES MAIN SECTION
        ======================================== */
        .resources-main {
            background: white;
            border-radius: 4px;
            padding: 12px;
            border: 1px solid #e9ecef;
        }

        .resources-header {
            margin-bottom: 12px;
            text-align: center;
        }

        .resources-header h2 {
            font-size: 1.3rem;
            color: var(--primary-color);
            margin-bottom: 3px;
            font-weight: 600;
        }

        .resources-header p {
            font-size: 0.8rem;
            color: #6c757d;
            margin: 0;
        }

        .filter-checkbox {
            display: flex;
            align-items: center;
        }

        /* ========================================
           MODERN STATS SECTION
        ======================================== */
        .modern-stats-section {
            background: white;
            padding: 20px 0;
            border-top: 1px solid #e9ecef;
        }

        .stats-header {
            text-align: center;
            margin-bottom: 20px;
        }

        .stats-header h3 {
            font-size: 1.2rem;
            color: var(--primary-color);
            margin-bottom: 5px;
            font-weight: 600;
        }

        .stats-header p {
            font-size: 0.85rem;
            color: #6c757d;
            margin: 0;
        }

        .modern-stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }

        .stat-card {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 6px;
            padding: 15px;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            border-color: var(--primary-color);
            background: white;
        }

        .stat-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: white;
            background: var(--primary-color);
        }

        .stat-icon.available {
            background: #10b981;
        }

        .stat-icon.free {
            background: #f59e0b;
        }

        .stat-icon.paid {
            background: #8b5cf6;
        }

        .stat-content {
            flex: 1;
        }

        .stat-number {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary-color);
            line-height: 1;
            margin-bottom: 2px;
        }

        .stat-label {
            font-size: 0.8rem;
            color: #6c757d;
            font-weight: 500;
        }

        .checkbox-label {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-weight: 500;
        }

        .checkbox-text {
            color: #6c757d;
        }

        /* ========================================
           MODERN RESOURCE GRID
        ======================================== */
        .resources-section {
            padding: 60px 0;
        }

        .resources-grid {
            display: grid;
            gap: 12px;
            width: 100%;
            margin-top: 15px;
        }

        /* Desktop: 5 columns */
        @media (min-width: 1400px) {
            .resources-grid {
                grid-template-columns: repeat(5, 1fr);
                gap: 12px;
            }
        }

        /* Laptop: 4 columns */
        @media (min-width: 1200px) and (max-width: 1399px) {
            .resources-grid {
                grid-template-columns: repeat(4, 1fr);
                gap: 12px;
            }
        }

        /* Tablet: 3 columns */
        @media (min-width: 768px) and (max-width: 1199px) {
            .resources-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 10px;
            }
        }

        /* Mobile: 2 columns */
        @media (max-width: 767px) {
            .resources-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .modern-stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .stat-card {
                padding: 12px;
            }

            .stat-icon {
                width: 35px;
                height: 35px;
                font-size: 1rem;
            }

            .stat-number {
                font-size: 1.3rem;
            }
        }

        .resource-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            overflow: hidden;
            transition: all 0.3s ease;
            cursor: pointer;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .resource-card:hover {
            transform: translateY(-2px);
            border-color: var(--primary-color);
        }

        .resource-card-img {
            height: 140px;
            background-size: cover;
            background-position: center;
            position: relative;
            background-color: #f3f4f6;
        }

        .resource-card-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .resource-card:hover .resource-card-img img {
            transform: scale(1.05);
        }

        .resource-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
            color: white;
            font-size: 2rem;
        }

        .resource-status {
            position: absolute;
            top: 12px;
            right: 12px;
        }

        .status-badge {
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .status-badge.available {
            background: #d1fae5;
            color: #065f46;
        }

        .status-badge.unavailable {
            background: #fee2e2;
            color: #991b1b;
        }

        .resource-content {
            padding: 12px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .resource-type {
            background: #dbeafe;
            color: #1e40af;
            padding: 4px 12px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.75rem;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 12px;
            width: fit-content;
        }

        .resource-content h3 {
            font-size: 0.95rem;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 6px;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .resource-content p {
            color: #6b7280;
            margin: 0 0 8px 0;
            line-height: 1.4;
            font-size: 0.8rem;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .resource-details {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 16px;
        }

        .detail-item {
            display: flex;
            align-items: center;
            gap: 6px;
            color: #6b7280;
            font-size: 0.8rem;
            font-weight: 500;
        }

        .detail-item i {
            color: var(--primary-color);
            width: 12px;
        }

        .resource-actions {
            margin-top: auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .price-tag {
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .price-tag.free {
            background: #d1fae5;
            color: #065f46;
        }

        .price-tag.paid {
            background: #fef3c7;
            color: #92400e;
        }

        .no-resources-message {
            grid-column: 1 / -1;
            text-align: center;
            padding: 60px 20px;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-radius: 12px;
            border: 2px dashed #dee2e6;
            margin: 20px 0;
        }

        .no-resources-message i {
            font-size: 64px;
            color: var(--secondary-color);
            margin-bottom: 20px;
            opacity: 0.8;
        }

        .no-resources-message h3 {
            color: var(--primary-color);
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 12px;
        }

        .no-resources-message p {
            color: #6c757d;
            font-size: 16px;
            margin: 0;
            line-height: 1.6;
            max-width: 500px;
            margin: 0 auto;
        }

        /* ========================================
           RESPONSIVE FILTER
        ======================================== */
        @media (max-width: 768px) {
            .library-main-container {
                padding: 8px 0;
            }
            
            .library-layout {
                grid-template-columns: 1fr;
                gap: 8px;
            }
            
            .filter-sidebar {
                position: static;
                order: 2;
                margin-top: 10px;
                padding: 10px;
            }
            
            .resources-main {
                order: 1;
                padding: 10px;
            }
            
            .resources-header h2 {
                font-size: 1.2rem;
            }
            
            .filter-header h3 {
                font-size: 0.95rem;
            }

            .resources-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 12px;
            }

            .resource-card-img {
                height: 160px;
            }

            .resource-content {
                padding: 16px;
            }
        }

        @media (max-width: 480px) {
            .library-main-container {
                padding: 5px 0;
            }
            
            .filter-sidebar {
                padding: 8px;
            }
            
            .resources-main {
                padding: 8px;
            }
            
            .resources-header h2 {
                font-size: 1.1rem;
            }
            
            .filter-header h3 {
                font-size: 0.9rem;
            }

            .resources-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .modern-stats-grid {
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .stat-card {
                padding: 10px;
            }

            .stat-icon {
                width: 32px;
                height: 32px;
                font-size: 0.9rem;
            }

            .stat-number {
                font-size: 1.2rem;
            }

            .stats-header h3 {
                font-size: 1.1rem;
            }

            .stats-header p {
                font-size: 0.8rem;
            }

            .resource-card-img {
                height: 140px;
            }

            .resource-content {
                padding: 12px;
            }

            .section-title h2 {
                font-size: 1.6rem;
            }
        }
