html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.category-filter-btn {
    transition: all 0.3s ease;
}

.category-filter-btn:hover {
    transform: translateY(-2px);
}

.category-filter-btn.active {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
}

.institution-card {
    transition: all 0.3s ease;
}

.institution-card:hover {
    transform: translateY(-4px);
}

.institution-card-wrapper.hidden {
    display: none;
}

.button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    border: 1px solid transparent;
}

.button.primary {
    background-color: #dc2626;
    color: white;
}

.button.primary:hover {
    background-color: #b91c1c;
}

.button.light-primary {
    background: #fee2e2;
    color: #dc2626;
}

.button.light-primary:hover {
    background: #fecaca;
}

.button.black {
    background: #1f2937;
    color: white;
}

.button.black:hover {
    background: #111827;
}

.button.secondary {
    background-color: white;
    color: #dc2626;
    border-color: #dc2626;
}

.button.secondary:hover {
    background-color: #fef2f2;
}

.course-card {
    background: white;
    border-radius: 1rem;
    padding: 0;
    border: 2px solid #fee2e2;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.course-card:hover {
    border-color: #dc2626;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.1);
}

.course-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.course-card .buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.course-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-image {
    height: 180px;
    width: 100%;
    object-fit: cover;
    background-color: #f3f4f6;
}

/* New Styles for Institution View Details */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #4b5563;
    font-weight: 500;
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.ranking-item {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ranking-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
}

.ranking-label {
    font-weight: 600;
    color: #1f2937;
    display: block;
}

.ranking-source {
    font-size: 0.75rem;
    color: #6b7280;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.why-item {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.why-item h4 {
    color: #dc2626;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.campuses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.campus-tag {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.page-header {
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.page-header h3,
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.page-header .button {
    font-size: 0.9rem;
}

.page-body {
    min-height: 60vh;
}

.course-list {
    margin-top: 2rem;
}

#institution-view,
#course-detail-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    z-index: 9999;
    /* Ensure it is on top of everything */
    background: white;
}

.country-section-pane.hidden,
#institution-view.hidden,
#course-detail-view.hidden {
    display: none;
}

.prose {
    max-width: 65ch;
}

.summary-about-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}
