* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    background: #eeeeee;
    background-image: linear-gradient(rgba(49, 90, 195, 0.3) 2.3px, transparent 2.3px), linear-gradient(to right, rgba(49, 90, 195, 0.3) 2.3px, #eeeeee 2.3px);
    background-size: 46px 46px;
    /* Prevent font loading CLS */
    font-display: swap;
}

header {
    background: rgba(217, 224, 244, 0.781);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem 0;
    margin-bottom: 2rem;
    /* Reserve space to prevent CLS */
    min-height: 140px;
}

main {
    /* Prevent main element shift by setting minimum height */
    min-height: calc(100vh - 240px);
}

header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    justify-content: center;
    /* Reserve minimum height to prevent CLS when buttons load */
    min-height: 44px;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    background: white;
    color: #a0b0f9;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover {
    background: #a0b0f9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.filter-btn.active {
    background: #a0b0f9;
    color: white;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
    /* Reserve minimum height to prevent CLS */
    min-height: 500px;
    /* Prevent grid auto-placement shifts */
    grid-auto-rows: minmax(400px, auto);
}

.benefit-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    /* Prevent CLS by setting minimum height */
    min-height: 400px;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: #fffbe6;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 20px;
    /* Prevent CLS by setting explicit aspect ratio */
    aspect-ratio: 8 / 5;
    /* Prevent layout shift during image load */
    display: block;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.card-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
    /* Prevent description from causing layout shifts */
    min-height: 60px;
    overflow: hidden;
}


.campus-warning {
    display: inline-block;
    background: #fff6e0;
    color: #d97706;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.35rem 0.8rem;
    margin-bottom: 0.7rem;
    margin-top: 0.2rem;
    box-shadow: 0 1px 4px rgba(217, 119, 6, 0.07);
    letter-spacing: 0.01em;
    border: 1px solid #ffe5b4;
    align-self: flex-start;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: #f1f2f8;
    color: #889eff;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

footer {
    background: rgba(217, 224, 244, 0.781);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    /* Prevent footer shift by ensuring min height above */
    min-height: 100px;
}

footer p {
    color: #666;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

.container {
    /* max-width: 1200px; */
    max-width: 2600px;
    margin: 0 auto;
    /* padding: 0 20px; */
    padding: 0 60px;
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        /* Maintain consistent height on mobile */
        min-height: 120px;
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 2rem;
    }

    .container {
        max-width: 100vw;
        padding: 0 20px;
    }
    
    main {
        /* Adjust main height for mobile */
        min-height: calc(100vh - 300px);
    }

    .benefits-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        /* Adjust minimum height for mobile */
        min-height: 600px;
        /* Ensure consistent row heights */
        grid-auto-rows: minmax(420px, auto);
    }

    .card-title {
        font-size: 1.2rem;
    }
    
    .benefit-card {
        /* Consistent minimum height on mobile */
        min-height: 420px;
    }
    
    .skeleton-card {
        /* Match benefit card height on mobile */
        min-height: 420px;
    }
}

@media (max-width: 480px) {
    .benefits-grid {
        grid-template-columns: 1fr;
        /* Single column minimum height */
        min-height: 800px;
        /* Consistent row heights for small screens */
        grid-auto-rows: minmax(450px, auto);
    }
    
    .benefit-card {
        /* Consistent card height on small screens */
        min-height: 450px;
    }
    
    .skeleton-card {
        /* Match benefit card height */
        min-height: 450px;
    }
    
    .card-image {
        /* Ensure consistent image height */
        min-height: 180px;
        max-height: 180px;
        height: 180px;
    }
    
    main {
        /* Larger minimum height for small screens */
        min-height: calc(100vh - 320px);
    }
}

/* Loading animation */
.loading {
    text-align: center;
    padding: 3rem;
    color: #333;
    font-size: 1.2rem;
    /* Reserve space to prevent CLS */
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Skeleton loader for better perceived performance */
.skeleton-card {
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    position: relative;
}

/* Remove animation to prevent CLS */
.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    /* Animation removed to prevent layout shifts */
}

/* Hide class for filtering */
.hidden {
    display: none;
}

/* Links do not turn purple when visited */
 a:visited {
    /* color: blue; */
    /* color: #0000EE */
    color: #516eed;
}

a:link {
    /* color: blue; */
    color: #516eed;
}