

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

:root {
    --primary-u-g: #c41e3a;
    --accent-u-g: #f39c12;
    --text-dark-u-g: #2c3e50;
    --text-light-u-g: #6b7280;
    --bg-light-u-g: #f8f9fa;
    --border-light-u-g: #e2e8f0;
    --white-u-g: #ffffff;
    --secondary-u-g: #1a1a2e;
}


.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Section */
.header {
    text-align: center;
    margin-bottom: 70px;
    animation: fadeInDown 0.8s ease-out;
}

.header h1 {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    color: var(--primary-u-g);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.header p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-light-u-g);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Grid Layout */
.universities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 50px;
}

@media (min-width: 768px) {
    .universities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .universities-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* University Card */
.university-card {
    background: var(--white-u-g);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: fadeInUp 0.6s ease-out backwards;
    cursor: pointer;
}

.university-card:nth-child(1) { animation-delay: 0.1s; }
.university-card:nth-child(2) { animation-delay: 0.15s; }
.university-card:nth-child(3) { animation-delay: 0.2s; }
.university-card:nth-child(4) { animation-delay: 0.25s; }
.university-card:nth-child(5) { animation-delay: 0.3s; }
.university-card:nth-child(6) { animation-delay: 0.35s; }
.university-card:nth-child(7) { animation-delay: 0.4s; }
.university-card:nth-child(8) { animation-delay: 0.45s; }

.university-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.card-image-container {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.university-card:hover .card-image {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 58, 82, 0.85) 0%, rgba(26, 58, 82, 0.3) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    transition: opacity 0.3s ease;
}

.dormitory-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(212, 165, 116, 0.95);
    color: var(--white-u-g);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.card-title {
    font-family: 'Crimson Pro', serif;
    font-size: 1.7rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--white-u-g);
    line-height: 1.3;
}

.card-location {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #fbbf24;
    font-size: 0.875rem;
}

.star.half {
    position: relative;
    color: #e5e7eb;
}

.star.half::before {
    content: '★';
    position: absolute;
    color: #fbbf24;
    width: 50%;
    overflow: hidden;
}

.rating-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Card Footer */
.card-footer {
    padding: 20px 12px;
    flex-direction: column;   /* 👈 add this */
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    background: var(--white-u-g);
    border-top: 1px solid var(--border-light-u-g);
}

.card-info {
    display: flex;
    gap: 20px;
    font-size: 0.875rem;
    color: var(--text-light-u-g);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-u-g);
}

.apply-btn {
    background: var(--primary-u-g);
    color: var(--white-u-g);
    padding: 6px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'DM Sans', sans-serif;
    width: 100%;
}

.apply-btn:hover {
    background: #0f2537;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 58, 82, 0.3);
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    animation: fadeIn 0.8s ease-out 0.5s backwards;
}

.load-more-btn {
    background: transparent;
    color: var(--primary-u-g);
    border: 2px solid var(--primary-u-g);
    padding: 14px 40px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-u-g);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: -1;
}

.load-more-btn:hover::before {
    width: 300px;
    height: 300px;
}

.load-more-btn:hover {
    color: var(--white-u-g);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 58, 82, 0.2);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .apply-btn {
        width: 100%;
        text-align: center;
    }
}
