@font-face {
            font-family: 'siemreap';
            src: url('../fonts/!KhmerOSSiemreap.ttf') format('truetype');
        }

        @font-face {
            font-family: 'baphnom';
            src: url('../fonts/Kh\ Baphnom\ Limon\ F2\ Version\ 2.50\ September\ 15\,\ 2017.ttf') format('truetype');

        }

        @font-face {
            font-family: 'chhlak';
            src: url('../fonts/Kh\ Ang\ ToaThmor\ 3.ttf') format('truetype');
        }

        :root {
            --primary-color: #1E88E5;
            --secondary-color: #1565C0;
            --accent-color: #FFC107;
            --light-color: #FFFFFF;
            --dark-color: #263238;
            --school-color: #00ACC1;
            --profile-color: #546E7A;
            --success-color: #4CAF50;
        }

        body {
            font-family: 'siemreap', serif;
            background-color: #f5f5f5;
            color: #333;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="none" stroke="%234A9D5E" stroke-width="0.5" opacity="0.1"/></svg>');
            background-size: 100px 100px;
        }

        .navbar {
            background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            top: 0;
            position: sticky;
            z-index: 999;
            font-family: 'chhlak';
        }

        .navbar-brand {
            font-weight: 400;
            color: white !important;
            letter-spacing: 1px;
            font-size: 1.3rem;
        }

        .khmer-title {
            font-weight: 300;
            font-size: 1.2rem;
            line-height: 30px;
            letter-spacing: 1px;
            font-family: 'chhlak';
        }

        h5 {
            font-weight: 400;
            font-family: 'chhlak';
        }

        .hero-section {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 3rem 0;
            margin-bottom: 2rem;
            position: relative;
            overflow: hidden;
            border-radius: 0 0 30px 30px;
        }

        .card {
            border: none;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.98);
        }

        .card:hover {
            transform: translateY(-8px);
            box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
        }

        .card-footer {
            margin-top: 2px;
        }

        .card-body {
            padding: 1.2rem;
        }

        .card-title {
            font-weight: 300;
            margin-bottom: 0.2rem;
            color: var(--dark-color);
            font-family: 'Baphnom';
        }

        .card-text {
            color: #555;
            font-size: 0.95rem;
        }

        .badge-category {
            background-color: var(--primary-color);
            color: white;
            margin-right: 5px;
            margin-bottom: 5px;
            font-weight: normal;
        }

        .filter-section {
            background-color: white;
            padding: 1.2rem;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            margin-bottom: 2rem;
        }

        .footer {
            background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
            color: white;
            padding: 2rem 0;
            margin-top: 3rem;
            position: relative;
        }

        .loading-spinner {
            display: none;
            text-align: center;
            padding: 2rem;
        }

        .pagination-container {
            display: flex;
            justify-content: center;
            margin-top: 30px;
        }

        .pagination {
            flex-wrap: wrap;
            justify-content: center;
        }

        .page-item.active .page-link {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }

        .page-link {
            color: var(--primary-color);
        }

        .page-item.disabled .page-link {
            color: #6c757d;
        }

        .no-results {
            text-align: center;
            padding: 3rem;
            background-color: rgba(255, 255, 255, 0.9);
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }

        .tags-section {
            margin-bottom: 1.5rem;
            padding: 0 0.5rem;
        }

        .tags-container {
            display: flex;
            overflow-x: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--primary-color) transparent;
            padding: 0.5rem 0;
            gap: 0.5rem;
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        .tags-container::-webkit-scrollbar {
            height: 6px;
        }

        .tags-container::-webkit-scrollbar-thumb {
            background-color: var(--primary-color);
            border-radius: 3px;
        }

        .tag {
            padding: 0.5rem 1.2rem;
            background-color: #eef7ff;
            border: 1px solid var(--primary-color);
            border-radius: 30px;
            font-size: 0.9rem;
            white-space: nowrap;
            cursor: pointer;
            transition: all 0.2s ease;
            color: var(--dark-color);
        }

        .tag:hover {
            background-color: var(--primary-color);
            color: white;
            transform: scale(1.05);
        }

        .tag.active {
            background-color: var(--primary-color);
            color: white;
            box-shadow: 0 4px 8px rgba(30, 136, 229, 0.3);
        }

        .tags-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
            padding: 0 0.5rem;
        }

        .tags-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--dark-color);
        }

        .scroll-hint {
            font-size: 0.85rem;
            color: #777;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .new-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background-color: var(--accent-color);
            color: white;
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: bold;
            z-index: 10;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }

        .card-date {
            position: absolute;
            top: 10px;
            left: 10px;
            background-color: rgba(255, 255, 255, 0.85);
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            z-index: 10;
        }

        .floating-book {
            position: absolute;
            width: 40px;
            height: 50px;
            background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
            border-radius: 3px;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
            z-index: 0;
            opacity: 0.5;
        }

        .floating-book:nth-child(1) {
            top: 10%;
            left: 5%;
            animation: float 15s infinite ease-in-out;
        }

        .floating-book:nth-child(2) {
            top: 30%;
            right: 7%;
            animation: float 18s infinite ease-in-out;
            animation-delay: -5s;
        }

        .floating-book:nth-child(3) {
            bottom: 20%;
            left: 15%;
            animation: float 12s infinite ease-in-out;
            animation-delay: -8s;
        }

        @keyframes float {
            0% {
                transform: translateY(0px) rotate(0deg);
            }

            50% {
                transform: translateY(-20px) rotate(5deg);
            }

            100% {
                transform: translateY(0px) rotate(0deg);
            }
        }

        .card-img-container {
            height: 200px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f8f9fa;
            position: relative;
        }

        .card-img-container img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .card:hover .card-img-container img {
            transform: scale(1.05);
        }

        .nav-link.active {
            font-weight: bold;
            position: relative;
        }

        .nav-link.active::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            right: 0;
            height: 3px;
            background-color: white;
            border-radius: 3px;
        }

        .home-section {
            padding: 3rem 0;
        }

        .welcome-card {
            background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
            color: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .welcome-header {
            background-color: rgba(0, 0, 0, 0.1);
            padding: 1.5rem;
            text-align: center;
        }

        .welcome-body {
            padding: 2rem;
        }

        .feature-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
            color: white;
            background: rgba(255, 255, 255, 0.2);
            width: 80px;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            margin: 0 auto 1.5rem;
        }

        .btn-nav {
            width: 100%;
            padding: 1rem;
            font-size: 1.1rem;
            font-weight: bold;
            margin: 0.5rem 0;
            transition: all 0.3s ease;
            border: none;
            color: white;
        }

        .btn-nav:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        .btn-library {
            background: linear-gradient(135deg, var(--primary-color), #3a8d5a);
        }

        .btn-profile {
            background: linear-gradient(135deg, var(--profile-color), #6a3e47);
        }

        .school-card .card-img-container {
            height: 180px;
        }

        .school-badge {
            background-color: var(--school-color);
            color: white;
        }

        .profile-section {
            padding: 3rem 0;
        }

        .profile-card {
            background: linear-gradient(135deg, var(--profile-color), var(--secondary-color));
            color: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .profile-header {
            text-align: center;
            padding: 2rem;
            background-color: rgba(0, 0, 0, 0.1);
        }

        .profile-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 5px solid white;
            margin: 0 auto 1rem;
            overflow: hidden;
            background-color: #ddd;
        }

        .profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-body {
            padding: 2rem;
            background-color: white;
            color: #333;
        }

        @media (max-width: 768px) {
            .card-img-container {
                height: 180px;
            }

            .hero-section h1 {
                font-size: 1.8rem;
            }

            .filter-section .col-md-6 {
                margin-bottom: 0.5rem;
            }

            .navbar-brand {
                font-size: 1.2rem;
            }

            .documentsContainer .col {
                flex: 0 0 50%;
                max-width: 50%;
            }

            .welcome-body {
                padding: 1.5rem;
            }
        }

        @media (max-width: 576px) {
            .hero-section {
                padding: 1.5rem 0;
            }

            .hero-section h1 {
                font-size: 1.5rem;
            }

            .hero-section p {
                font-size: 0.9rem;
            }

            .filter-section .row>div {
                margin-bottom: 0.5rem;
            }

            .card-img-container {
                height: 150px;
            }

            .card-body {
                padding: 1rem;
            }

            .card-title {
                font-size: 1rem;
            }

            .card-text {
                font-size: 0.8rem;
            }

            .new-badge,
            .card-date {
                font-size: 0.65rem;
                padding: 3px 6px;
            }

            .nav-link i {
                font-size: 1.2rem;
            }

            .welcome-body {
                padding: 1rem;
            }

            .tags-title {
                font-size: 1rem;
            }
        }

        .animate-fade-in {
            animation: fadeIn 0.5s ease-in;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .animate-slide-up {
            animation: slideUp 0.5s ease-out;
        }

        @keyframes slideUp {
            from {
                transform: translateY(20px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .main-section {
            display: none;
        }

        .main-section.active {
            display: block;
            animation: fadeIn 0.5s ease-in;
        }

        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--secondary-color);
        }

        .stat-number {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 0.2rem;
        }

        .stat-label {
            font-size: 0.9rem;
            color: #555;
        }

        .section-title {
            position: relative;
            padding-bottom: 15px;
            margin-bottom: 30px;
            text-align: center;
        }

        .section-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
            border-radius: 2px;
        }

        .cta-section {
            background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
            padding: 4rem 0;
            color: white;
            text-align: center;
            margin: 3rem 0;
            border-radius: 20px;
        }

        .cta-title {
            font-size: 1.3rem;
            margin-bottom: 1.5rem;
            font-weight: 300;
        }

        .stat-card {
            text-align: center;
            padding: 20px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.9);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            margin-bottom: 20px;
        }

        /* បន្ថែម CSS ថ្មីសម្រាប់ការផ្ទុករហ័ស */
        .card-img-container {
            height: 200px;
            overflow: hidden;
            position: relative;
            background-color: #f8f9fa;
        }

        .card-img-container img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        /* Skeleton loading */
        .skeleton-loading {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            z-index: 1;
        }

        @keyframes loading {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        /* កែលម្អប្រសិទ្ធភាពសម្រាប់រូបភាព */
        .card-img-container img.loaded {
            opacity: 1;
            transition: opacity 0.3s ease;
        }

        .card-img-container img:not(.loaded) {
            opacity: 0;
        }

        /* Skeleton loading animation */
        .skeleton-loading {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            z-index: 1;
        }

        @keyframes loading {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        /* Image loading transitions */
        .card-img-container img {
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .card-img-container img.loaded {
            opacity: 1;
        }

        /* Improved image loading styles */
        .card-img-container {
            position: relative;
            height: 200px;
            overflow: hidden;
            background-color: #f8f9fa;
        }

        .card-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .card-img.loaded {
            opacity: 1;
        }

        .skeleton-loading {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            z-index: 1;
        }

        @keyframes loading {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        /* កែលម្អការបង្ហាញចំនួនស្ថិតិ */
        .stat-number {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 0.2rem;
            font-family: 'baphnom';
            transition: transform 0.3s ease;
        }

        .stat-number.animating {
            animation: pulse 0.5s ease-in-out;
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.1);
            }

            100% {
                transform: scale(1);
            }
        }

        .stat-label {
            font-size: 0.9rem;
            color: #555;
            transition: all 0.3s ease;
        }

        .stat-container:hover .stat-number {
            color: var(--secondary-color);
            transform: translateY(-5px);
        }

        .stat-container:hover .stat-label {
            color: var(--primary-color);
            transform: translateY(2px);
        }

        /* បន្ថែមរចនាប័ទ្មសម្រាប់ចលនាចំនួន */
        @keyframes countUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-count {
            animation: countUp 0.5s ease-out forwards;
        }
        .logo{
            width: 35px;
        }