html, body {
    overflow-x: auto !important;
    overflow-y: visible !important;
    overflow: visible !important;
    }

body {
    overflow: visible !important;
    position: relative !important;
}

.page-container {
    overflow: visible !important;
    position: relative !important;
}

.flex.flex-col.md\\:flex-row {
    overflow: visible !important;
}

@media screen and (max-width: 1164px) {
    .header .mobile-menu-toggle {
        display: flex !important;
    }

    .header .nav-menu {
        display: none !important;
    }

    .header .desktop-only {
        display: none !important;
    }
}

@media screen and (min-width: 1165px) {
    .header .mobile-menu-toggle {
        display: none !important;
    }

    .header .nav-menu {
        display: flex !important;
    }

    .header .desktop-only {
        display: inline-flex !important;
    }
}

.header {
    opacity: 1 !important;
    visibility: visible !important;
    font-family: 'Inter', sans-serif;
    color: var(--header-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--header-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.header .navbar {
    display: flex;
    align-items: center;
    height: 40px;
    position: relative;
    padding: 0;
}

ma-header:empty {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: var(--header-glass-bg);
}

.page-container {
    width: 100%;
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeInPage 0.3s ease-in forwards;
    overflow: visible;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Urbanist', sans-serif;
    background-color: #F8F9FA; padding-top: 80px;
}

:root {
    --header-text-primary: #1f2937;
    --header-text-secondary: #6b7280;
    --header-glass-bg: rgba(255, 255, 255, 0.8);
    --header-purple-main: #611F69;
    --header-purple-light-bg: rgba(139, 92, 246, 0.1);
    --header-white: #ffffff;
    --header-transition-speed: 0.2s;
    --header-transition-easing: ease;
    --header-red-logo: #ef4444;

    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --text-color-dark: #1f2937;
    --text-color-light: #6b7280;
    --primary-color: #611F69;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    --courses-text-primary: #111827;
    --courses-text-secondary: #6B7280;
    --courses-bg-main: #F9FAFB;
    --courses-bg-white: #FFFFFF;
    --courses-border-color: #E5E7EB;
    --courses-brand-purple: #611F69;
    --courses-brand-pink: #EC4899;
    --courses-font-sans: 'urbanist', sans-serif;
}

.filter-sidebar-container {
    position: sticky !important;
    top: 6rem !important;
    align-self: flex-start !important;
    z-index: 100 !important;
    }

@media (min-width: 768px) {
    .filter-sidebar-container {
        position: sticky !important;
        top: 6rem !important;
        align-self: flex-start !important;
        z-index: 100 !important;
    }
}

.page-container .filter-sidebar-container,
div.filter-sidebar-container {
    position: sticky !important;
    top: 6rem !important;
    align-self: flex-start !important;
    z-index: 100 !important;
}

.filter-sidebar {
    background: white !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    padding: 1.25rem !important;
    max-height: calc(100vh - 6rem) !important;
    overflow-y: auto !important;
    border: none !important;
    width: 100% !important;
    position: relative !important;
}

.container .accordion-toggle,
.container .w-full .accordion-toggle {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 0 !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    text-align: left !important;
    transition: color 0.2s !important;
}

.container .accordion-toggle:hover,
.container .w-full .accordion-toggle:hover {
    color: #611F69 !important;
}

.container .accordion-content,
.container .w-full .accordion-content {
    padding-left: 0.5rem !important;
    padding-top: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #5A6474 !important;
    display: none !important;
    transition: all 0.2s ease !important;
}

.container .accordion-content.show,
.container .w-full .accordion-content.show,
.container .accordion-content:target,
.container .w-full .accordion-content:target {
    display: block !important;
}

.accordion-content {
    display: none !important; transition: all 0.2s ease !important;
}

.accordion-content.show {
    display: block !important;
}

.accordion-toggle.open .fa-chevron-down {
    transform: rotate(180deg);
}

.container .accordion-content a,
.container .w-full .accordion-content a {
    display: block !important;
    margin-bottom: 0.5rem !important;
    cursor: pointer !important;
    color: #5A6474 !important;
    transition: color 0.2s !important;
    font-weight: normal !important;
    text-decoration: none !important;
}

.container .accordion-content a:hover,
.container .w-full .accordion-content a:hover {
    color: #611F69 !important;
}

.container .accordion-content .font-medium,
.container .w-full .accordion-content .font-medium {
    font-weight: 500 !important;
    color: #4b5563 !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
}

.container .accordion-content ul,
.container .w-full .accordion-content ul {
    padding-left: 0.75rem !important;
    list-style: none !important;
}

.container .accordion-content ul li,
.container .w-full .accordion-content ul li {
    margin-bottom: 0.5rem !important;
}

.container .accordion-content .bg-custom-purple-light,
.container .w-full .accordion-content .bg-custom-purple-light {
    background-color: #F3F0FF !important;
    color: #611F69 !important;
    font-weight: 500 !important;
    padding: 0.5rem !important;
    border-radius: 0.375rem !important;
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
}

.container .accordion-toggle .fas,
.container .w-full .accordion-toggle .fas,
.container .accordion-toggle i,
.container .w-full .accordion-toggle i {
    width: 12px !important;
    height: 12px !important;
    transition: transform 0.2s !important;
    color: #6b7280 !important;
    font-size: 12px !important;
}

.container .accordion-toggle.open .fas,
.container .w-full .accordion-toggle.open .fas,
.container .accordion-toggle.open i,
.container .w-full .accordion-toggle.open i {
    transform: rotate(180deg) !important;
}

.filter-options {
    display: none;
    padding-left: 0.5rem;
    padding-top: 0.5rem;
    font-size: 0.875rem;
    color: #5A6474;
    transition: all 0.2s ease;
    max-height: 0;
    overflow: hidden;
}

.filter-options.show,
.filter-group.open .filter-options {
    display: block !important;
    max-height: 500px !important;
    padding-bottom: 0.5rem !important;
}

.filter-toggle {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 0 !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    text-align: left !important;
    transition: color 0.2s !important;
}

.filter-toggle:hover {
    color: #611F69 !important;
}

.filter-toggle .chevron-icon,
.filter-toggle svg {
    transition: transform 0.2s !important;
    color: #6b7280 !important;
    width: 16px !important;
    height: 16px !important;
}

.filter-group.open .filter-toggle .chevron-icon,
.filter-group.open .filter-toggle svg {
    transform: rotate(180deg) !important;
}

.filter-options label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    cursor: pointer !important;
    color: #5A6474 !important;
    transition: color 0.2s !important;
    font-weight: normal !important;
    font-size: 0.875rem !important;
}

.filter-options label:hover {
    color: #611F69 !important;
}

.filter-options input[type="checkbox"] {
    margin-right: 0.5rem !important;
}

.filter-end-message {
    text-align: center;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

.filter-end-message p {
    margin: 0;
}

.filter-subgroup {
    margin-bottom: 1rem !important;
}

.filter-subheading {
    font-weight: 500 !important;
    color: #4b5563 !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
    margin-top: 0 !important;
}

.filter-group {
    margin-bottom: 1rem !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding-bottom: 1rem !important;
}

.selected-filters-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.selected-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filters-label {
    font-weight: 600;
    color: var(--text-color-dark);
    font-size: 0.9rem;
}

.clear-all-filters {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-filters:hover {
    background-color: #FEE2E2;
    border-color: #EF4444;
    color: #DC2626;
}

.selected-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.selected-filter-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.selected-filter-tag span {
    line-height: 1;
}

.remove-filter {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    line-height: 1;
}

.remove-filter:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

ma-footer {
    margin-top: 3rem !important;
    clear: both !important;
    width: 100% !important;
}

body > .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 1rem 2rem !important;
}

body > .container .flex {
    display: flex !important;
    gap: 1.5rem !important;
}

@media (min-width: 768px) {
    .md\:overflow-y-auto::-webkit-scrollbar {
        width: 6px;
    }
    .md\:overflow-y-auto::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    .md\:overflow-y-auto::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 10px;
    }
    .md\:overflow-y-auto::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

@media (max-width: 768px) {
    .container .flex {
        flex-direction: column !important;
    }

    .container .filter-sidebar,
    .container .w-full .filter-sidebar,
    .container .w-full .md\:w-1\/4 {
        position: static !important;
        max-height: none !important;
        margin-bottom: 1.5rem !important;
        top: auto !important;
    }
}

.test-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: box-shadow 0.2s, transform 0.2s;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 1;
    animation-delay: var(--delay);
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.test-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card-main {
    flex: 1;
    min-width: 0;
}

.card-main h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color-dark);
    font-weight: 600;
}

.test-duration {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin-bottom: 1rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tag-break {
    flex-basis: 100%;
    height: 0;
}

.tag {
    font-size: 0.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: 15px;
    font-weight: 500;
    max-width: calc(50% - 0.25rem);
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    border: none;
    cursor: default;
}

.tag-blue {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.tag-green {
    background-color: #D1FAE5;
    color: #065F46;
}

.tag-orange {
    background-color: #FFE4E1;
    color: #991B1B;
}

.tag-red {
    background-color: #FEE2E2;
    color: #991B1B;
}

.tag-purple {
    background-color: #E9D5FF;
    color: #5B21B6;
}

.tag-yellow {
    background-color: #FEF3C7;
    color: #92400E;
}

.tag-gray {
    background-color: #F3F4F6;
    color: #4B5563;
}

.tag-pink {
    background-color: #FCE7F3;
    color: #BE185D;
}

.tag-indigo {
    background-color: #E0E7FF;
    color: #3730A3;
}

.tag-teal {
    background-color: #CCFBF1;
    color: #0F766E;
}

.tag-cyan {
    background-color: #CFFAFE;
    color: #0E7490;
}

.tag-lime {
    background-color: #ECFCCB;
    color: #365314;
}

.tag-emerald {
    background-color: #D1FAE5;
    color: #047857;
}

.tag-violet {
    background-color: #EDE9FE;
    color: #6D28D9;
}

.tag-rose {
    background-color: #FFE4E6;
    color: #E11D48;
}

.tag-amber {
    background-color: #FEF3C7;
    color: #D97706;
}

.tag-slate {
    background-color: #F1F5F9;
    color: #475569;
}

.tag-sky {
    background-color: #E0F2FE;
    color: #0284C7;
}

.tag-fuchsia {
    background-color: #FAE8FF;
    color: #A21CAF;
}

.tag-more {
    position: relative;
    cursor: pointer;
    background-color: #F3F4F6 !important;
    color: #4B5563 !important;
    font-size: 0.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: 15px;
    font-weight: 500;
    transition: transform 0.2s;
    z-index: 10000;
    pointer-events: auto;
}

.tag-more:hover {
    transform: scale(1.05);
    background-color: #E5E7EB !important;
    color: #374151 !important;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    min-width: 180px;
    justify-content: flex-end;
}

.btn-take-test {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 26px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color-dark);
    font-size: 0.875rem;
}

.btn-take-test:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-take-test:disabled {
    background-color: #f5f5f5;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-take-test:disabled:hover {
    background-color: #f5f5f5;
    color: #999;
    border-color: #ddd;
    transform: none;
}

.info-button {
    background-color: var(--card-background);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.info-icon {
    cursor: pointer;
    color: var(--text-color-light);
    transition: color 0.2s;
}

.info-icon:hover {
    color: var(--primary-color);
}

.library-header {
    background: var(--12, linear-gradient(35deg, rgba(225, 244, 255, 0.60) 12%, rgba(249, 225, 255, 0.80) 27%, rgba(255, 230, 233, 0.60) 100%));
    padding: 2rem;
    border-radius: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.library-header-content {
    flex: 1;
    max-width: 60%;
    z-index: 2;
}

.library-header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(87deg, #8253C2 2.38%, #F45346 85.76%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 1rem 0;
}

.library-header-content p {
    font-size: 1.1rem;
    color: #383838;
    max-width: 800px;
    line-height: 1.6;
    margin: 0;
}

.courses-hero-image-container {
    position: relative;
    width: 350px;
    height: 350px;
    flex: 0 0 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.courses-hero-image {
    border-radius: 1.5rem;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 100%;
    max-height: 100%;
    position:relative;
    top:33px;
    bottom:auto !important;
}

.courses-floating-icon {
    position: absolute;
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0.75rem;
    animation: float 6s ease-in-out infinite;
    z-index: 3;
    width: auto;
    max-width: 280px;
    min-width: 250px;
}

.courses-floating-icon-1 {
    bottom: 15%;
    left: -20%;
    position: absolute;
    gap: 0.75rem;
}


.courses-floating-icon-2 {
    position: absolute;
    top: 20%;
    right: 8%;
    animation-delay: -3s;
    z-index: 3;
    animation: float 6s ease-in-out infinite;
}

.courses-floating-text {
    display: flex;
    flex-direction: column;
}

.courses-floating-text strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.courses-floating-text span {
    font-size: 0.875rem;
    color: #6b7280;
}

.search-container {
    background: white;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s;
}

.search-container:focus-within {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.search-container input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
}

.search-container input::placeholder {
    color: #9ca3af;
}

.search-icon {
    color: #9ca3af;
    flex-shrink: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.mobile-top-filter-bar {
    display: none;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.mobile-top-filter-bar::-webkit-scrollbar {
    display: none;
}

.mobile-filter-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: max-content;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(97, 31, 105, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-filter-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(97, 31, 105, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(97, 31, 105, 0.3);
}

.mobile-filter-btn svg {
    flex-shrink: 0;
}

.filter-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-filter-btn:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.top-filter-btn svg {
    flex-shrink: 0;
}

.chevron-down {
    transition: transform 0.2s ease;
}

.top-filter-btn.active .chevron-down {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .mobile-top-filter-bar {
        display: flex;
    }

    .test-card {
        flex-direction: column;
        align-items: stretch;
    }

    .card-main {
        margin-bottom: 1rem;
    }

    .card-action {
        min-width: auto;
        justify-content: flex-start;
    }

    .tag-list {
        margin-bottom: 1rem;
    }

    .tag {
        max-width: none !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        word-wrap: break-word;
        line-height: 1.3;
    }

    .library-header {
        flex-direction: column;
        text-align: center;
        padding: 3rem 1.5rem;
    }

    .library-header-content {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .library-header-content h1 {
        font-size: 2.25rem;
    }

    .library-header-content p {
        font-size: 1rem;
        max-width: 100%;
    }

    .courses-hero-image {
        width: 280px;
    }

    .courses-floating-icon-1 {
        left: -1rem;
        bottom: 1rem;
    }

    .courses-floating-icon-2 {
        right: -1rem;
        top: 1rem;
    }

    .search-container {
        margin: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .library-header-content h1 {
        font-size: 1.875rem;
    }

    .courses-hero-image {
        width: 240px;
    }

    .courses-floating-icon {
        padding: 0.75rem;
        transform: scale(0.9);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0;
    line-height: 1.6;
    color: #374151;
}

.tag-tooltip-overlay {
    position: absolute;
    background: var(--card-background, white);
    color: var(--text-color-dark, #374151);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 10001;
    box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.1), 0 6px 8px -3px rgba(0, 0, 0, 0.04);
    width: fit-content;
    max-width: 300px;
    min-width: auto;
    height: fit-content;
    min-height: auto;
    max-height: 180px;
    border: 1px solid var(--border-color, #e5e7eb);
    display: none;
}

.tag-tooltip-overlay::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px; border: 9px solid transparent;
    border-bottom-color: var(--border-color, #e5e7eb);
    z-index: 10002;
}

.tag-tooltip-overlay::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 21px; border: 8px solid transparent;
    border-bottom-color: var(--card-background, white);
    z-index: 10003;
}

.tag-tooltip-overlay .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-start;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.tag-tooltip-overlay .tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    display: inline-block;
    min-width: auto;
    width: auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

.test-card.has-tooltip {
    z-index: 10000;
    position: relative;
}

@media (max-width: 768px) {
    .tag-tooltip-overlay {
        position: absolute;
        top: auto;
        bottom: 70px; left: 0.75rem;
        right: 0.75rem;
        margin: 0;
        width: calc(100% - 1.5rem);
        min-width: auto;
        max-width: calc(100vw - 3rem); height: auto;
        min-height: auto;
        max-height: 150px; background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        border: 1px solid #e5e7eb;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        box-sizing: border-box;
        overflow-y: auto; overflow-x: hidden;
        padding: 0.75rem;
        border-radius: 8px;
        z-index: 10001;
    }
    .tag-tooltip-overlay::before {
        display: none; }
    .tag-tooltip-overlay .tag-list {
        display: flex;
        justify-content: flex-start;
        max-width: calc(100% - 0.5rem); width: calc(100% - 0.5rem); height: auto;
        gap: 0.35rem;
        flex-wrap: wrap;
        box-sizing: border-box;
        align-content: flex-start;
        align-items: flex-start;
        overflow: visible;
        margin: 0;
        padding: 0.25rem;
        line-height: normal;
        border: 1px solid transparent; }
    .tag-tooltip-overlay .tag {
        font-size: 0.65rem;
        padding: 0.3rem 0.45rem;
        min-width: auto;
        max-width: calc(45% - 0.2rem); width: auto;
        white-space: nowrap;
        flex-shrink: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 12px;
        line-height: 1.2;
        box-sizing: border-box;
        vertical-align: top;
    }
    .test-card {
        position: relative;
        overflow: visible;
    }
}

@media (max-width: 480px) {
    .tag-tooltip-overlay {
        left: 0.5rem;
        right: 0.5rem;
        width: calc(100% - 1rem);
        max-width: calc(100vw - 2rem);
        max-height: 120px;
        padding: 0.6rem;
        bottom: 65px;
    }
    .tag-tooltip-overlay .tag-list {
        max-width: calc(100% - 0.25rem);
        width: calc(100% - 0.25rem);
        gap: 0.3rem;
        padding: 0.2rem;
    }
    .tag-tooltip-overlay .tag {
        font-size: 0.6rem;
        padding: 0.25rem 0.4rem;
        max-width: calc(43% - 0.15rem); border-radius: 10px;
    }
}

@media (max-width: 360px) {
    .tag-tooltip-overlay {
        left: 0.25rem;
        right: 0.25rem;
        width: calc(100% - 0.5rem);
        max-width: calc(100vw - 1rem);
        max-height: 100px;
        padding: 0.5rem;
        bottom: 60px;
    }
    .tag-tooltip-overlay .tag-list {
        max-width: 100%;
        width: 100%;
        gap: 0.25rem;
        padding: 0.1rem;
    }
    .tag-tooltip-overlay .tag {
        font-size: 0.55rem;
        padding: 0.2rem 0.35rem;
        max-width: calc(40% - 0.1rem); border-radius: 8px;
        line-height: 1.1;
    }
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    flex: 1;
    margin-bottom: 2rem;
    align-items: start;
    overflow: visible;
    min-height: 100vh;
}

.test-listings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 1024px) and (min-width: 769px) {
    .main-content {
        grid-template-columns: 260px 1fr;
        gap: 1.5rem;
    }

    .filters-sidebar {
        width: 240px;
    }
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    width: 100%;
    grid-column: 1 / -1; margin: 1rem 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #611F69;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator span {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.end-of-results {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.end-of-results p {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.end-of-results small {
    font-size: 0.8rem;
    opacity: 0.8;
}

.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-search-overlay.active {
    transform: translateX(0);
}

.mobile-search-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 1rem;
}

.mobile-search-back {
    background: none;
    border: none;
    color: #374151;
    cursor: pointer;
}

.mobile-search-input-container {
    position: relative;
    flex: 1;
}

.mobile-search-input-container input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.mobile-search-input-container input:focus {
    border-color: #611F69;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mobile-search-input-container .search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    z-index: 10;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

.search-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.search-empty-state p {
    font-size: 0.875rem;
    opacity: 0.8;
}

.mobile-search-result-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-search-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #611F69;
}

.mobile-search-result-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.mobile-search-result-card .duration {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.mobile-search-result-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.mobile-search-result-card .tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-filter-overlay.active {
    transform: translateX(0);
}

.mobile-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-filter-back {
    background: none;
    border: none;
    color: #374151;
    cursor: pointer;
}

.mobile-clear-filters {
    background: none;
    border: none;
    color: #611F69;
    cursor: pointer;
    font-weight: 500;
}

.mobile-filter-categories {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

.mobile-category-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.mobile-category-btn.active {
    color: #611F69;
    border-bottom-color: #611F69;
}

.mobile-filter-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-filter-section {
    display: none;
}

.mobile-filter-section.active {
    display: block;
}

.mobile-filter-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.75rem 0;
}

.mobile-filter-section h4:first-child {
    margin-top: 0;
}

.mobile-filter-section label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
}

.mobile-filter-section label:last-child {
    border-bottom: none;
}

.mobile-filter-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #611F69;
}

.mobile-filter-footer {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
}

.mobile-apply-filters {
    width: 100%;
    padding: 1rem;
    background: #611F69;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: none; justify-content: center;
    gap: 2rem;
    padding: 1rem;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    .mobile-selected-filters-section {
        display: block;
    }
}

.mobile-bottom-nav.visible {
    transform: translateY(0);
}

.mobile-nav-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    min-width: 60px;
}

.mobile-nav-btn span {
    font-size: 0.75rem;
}

body.mobile-search-active .mobile-bottom-nav,
body.mobile-filter-active .mobile-bottom-nav {
    display: none;
}

body.mobile-search-active,
body.mobile-filter-active {
    overflow: hidden;
}

.mobile-selected-filters-section {
    display: none; background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.mobile-selected-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.mobile-filters-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.mobile-clear-all-filters {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mobile-clear-all-filters:hover {
    background: #fef2f2;
}

.mobile-selected-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mobile-top-filter-bar {
    display: none;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.mobile-top-filter-bar::-webkit-scrollbar {
    display: none;
}

.top-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    min-width: max-content;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.top-filter-btn:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #611F69;
    color: #611F69;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.top-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-filter-btn.active {
    background: linear-gradient(135deg, #611F69 0%, #7c3aed 100%);
    border-color: #611F69;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.top-filter-btn svg {
    flex-shrink: 0;
}

.top-filter-btn .chevron-down {
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.top-filter-btn:hover .chevron-down {
    transform: rotate(180deg);
}

.mobile-filter-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: #611F69;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: max-content;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-filter-btn:hover {
    background: #611F69;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.mobile-filter-btn svg {
    flex-shrink: 0;
}

.filter-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

@media (max-width: 768px) {
    .page-container {
        margin: 0.5rem auto;
        padding: 0 0.5rem;
        padding-bottom: 100px; }

    .library-header {
        margin-top: 1rem;
        padding: 1.5rem;
        margin-bottom: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .library-header-content {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .library-header-content h1 {
        font-size: 2.25rem;
    }

    .library-header-content p {
        font-size: 1rem;
        max-width: 100%;
    }

    .courses-hero-image {
        width: 280px;
    }

    .courses-floating-icon-1 {
        left: -1rem;
        bottom: 1rem;
    }

    .courses-floating-icon-2 {
        right: -1rem;
        top: 1rem;
    }

    .search-container {
        display: none;
    }

    .filters-sidebar,
    .filter-sidebar {
        display: none !important;
    }

    .selected-filters-section {
        display: none !important; }

    .flex.flex-col.md\\:flex-row {
        flex-direction: column !important;
    }

    .w-full.md\\:w-1\/4.md\\:sticky.md\\:top-24.md\\:self-start {
        display: none !important;
    }

    .w-full.md\\:w-3\/4 {
        width: 100% !important;
    }

    .mobile-top-filter-bar {
        display: flex;
    }

    .mobile-selected-filters-section {
        display: none !important; }

    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-left: 0;
    }

    .test-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        position: relative;
        overflow: visible;
    }

    .card-action {
        width: 100%;
        justify-content: space-between;
    }

    .selected-filters-section {
        padding: 0.75rem;
    }

    .selected-filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .mobile-bottom-nav {
        display: flex !important;
        transform: translateY(0); }

    .tag-list {
        gap: 0.4rem !important;
        width: 100% !important;
    }

    .tag {
        font-size: 0.68rem !important;
        padding: 0.4rem 0.65rem !important;
        max-width: none !important;
        min-width: 0;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        word-wrap: break-word;
        line-height: 1.3;
    }

}

@media (max-width: 480px) {
    .library-header-content h1 {
        font-size: 1.875rem;
    }

    .courses-hero-image {
        width: 240px;
    }

    .courses-floating-icon {
        padding: 0.75rem;
        transform: scale(0.9);
    }

    .search-container {
        margin: 1.5rem 0;
    }

    .tag-list {
        gap: 0.3rem !important;
        width: 100% !important;
    }

    .tag {
        font-size: 0.65rem !important;
        padding: 0.35rem 0.6rem !important;
        max-width: none !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        word-wrap: break-word;
        line-height: 1.3;
    }

}

.mobile-tag-break {
    display: none;
}

@media (max-width: 768px) {
    .mobile-tag-break {
        display: block;
        width: 100%;
        height: 0;
        flex-basis: 100%;
        order: 99;
    }

    .tag-more {
        order: 100;
    }

    .tag {
        max-width: none !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        word-wrap: break-word;
        line-height: 1.3;
    }

    .tag-list {
        align-items: flex-start;
    }
}