@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-green: #064e3b;
    --emerald-green: #047857;
    --emerald-light: #10b981;
    --accent-gold: #d4af37;
    --gold-bright: #fbbf24;
    --bg-dark: #f0faf5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(4, 120, 87, 0.15);
    --text-light: #064e3b;
    --text-muted: #475569;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 10%, rgba(16, 185, 129, 0.12) 0px, transparent 55%),
        radial-gradient(at 90% 90%, rgba(212, 175, 55, 0.1) 0px, transparent 55%);
    background-attachment: fixed;
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background glowing orb */
body::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--emerald-green);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--emerald-light);
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(4, 120, 87, 0.06);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Header Design */
.header-section {
    padding: 70px 0 20px;
    text-align: center;
}

.school-logo {
    max-height: 100px;
    filter: drop-shadow(0 4px 10px rgba(4, 120, 87, 0.2));
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.school-logo:hover {
    transform: rotate(360deg) scale(1.1);
}

.main-title {
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #022c22 60%, var(--emerald-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 20px;
}

.sub-title {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 300;
    max-width: 650px;
    margin: 8px auto 0;
    line-height: 1.6;
}

/* Search Bar Wrapper */
.search-container {
    max-width: 580px;
    margin: 25px auto 45px;
    position: relative;
    box-shadow: 0 4px 20px rgba(4, 120, 87, 0.08);
    border-radius: 30px;
}

.search-input {
    background: #ffffff !important;
    border: 1px solid var(--border-glass) !important;
    color: #0f172a !important;
    border-radius: 30px !important;
    padding: 14px 25px 14px 55px !important;
    font-size: 1.05rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-input:focus {
    box-shadow: 0 0 15px rgba(4, 120, 87, 0.15) !important;
    border-color: var(--emerald-light) !important;
    background: #ffffff !important;
}

.search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* Categories Navigation Tabs */
.nav-categories {
    border: none !important;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.category-tab {
    background: #ffffff !important;
    border: 1px solid var(--border-glass) !important;
    color: #475569 !important;
    border-radius: 25px !important;
    padding: 10px 22px !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.04);
}

.category-tab:hover {
    background: #f8fafc !important;
    color: var(--emerald-green) !important;
    border-color: var(--emerald-light) !important;
    transform: translateY(-2px);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--emerald-green), var(--primary-green)) !important;
    border-color: var(--accent-gold) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.4);
    transform: translateY(-2px);
}

.category-tab i {
    margin-right: 8px;
    color: var(--accent-gold);
    transition: transform 0.3s ease;
}

.category-tab:hover i {
    transform: scale(1.15);
}

.category-tab.active i {
    color: var(--gold-bright);
}

/* Portals Grid Layout */
.portals-grid {
    transition: all 0.3s ease;
}

/* Portal Card Style */
.portal-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 26px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-decoration: none;
    color: #1e293b;
}

.portal-card:hover {
    transform: translateY(-8px);
    background: #ffffff;
    box-shadow: 0 16px 35px rgba(4, 120, 87, 0.1), 0 0 20px rgba(4, 120, 87, 0.05);
    border-color: rgba(212, 175, 55, 0.5);
    color: var(--emerald-green);
}

/* Dynamic left border indicator */
.portal-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--portal-color, var(--emerald-green));
    transition: width 0.3s ease;
}

.portal-card:hover::after {
    width: 7px;
}

.portal-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    margin-bottom: 22px;
    background: rgba(4, 120, 87, 0.05);
    border: 1px solid rgba(4, 120, 87, 0.1);
    color: var(--portal-color, var(--text-light));
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.portal-card:hover .portal-icon-wrapper {
    background: var(--portal-color, var(--emerald-green));
    color: #fff !important;
    transform: scale(1.12) rotate(3deg);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.portal-name {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.35;
    transition: color 0.3s ease;
    color: #0f172a;
}

.portal-card:hover .portal-name {
    color: var(--emerald-green);
}

.portal-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 20px;
}

/* Card badges */
.portal-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(4, 120, 87, 0.08);
    padding-top: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.portal-card:hover .card-footer-info {
    color: #475569;
}

.redirect-arrow {
    transition: transform 0.3s ease;
}

.portal-card:hover .redirect-arrow {
    transform: translateX(5px);
    color: var(--accent-gold);
}

/* Floating back button / login admin shortcut */
.admin-shortcut {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.admin-shortcut:hover {
    opacity: 1;
    transform: scale(1.08);
}

.admin-btn {
    background: #ffffff !important;
    color: var(--emerald-green) !important;
    border-color: rgba(4, 120, 87, 0.15) !important;
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.08);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    text-decoration: none !important;
}

.admin-btn:hover {
    box-shadow: 0 6px 25px rgba(4, 120, 87, 0.18);
    color: var(--accent-gold) !important;
    border-color: var(--accent-gold) !important;
}

/* Footer Section */
.footer-text {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 60px 0 35px;
    text-align: center;
    font-weight: 300;
    line-height: 1.8;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .main-title {
        font-size: 1.9rem;
    }
    .header-section {
        padding: 50px 0 20px;
    }
    .category-tab {
        font-size: 0.88rem;
        padding: 8px 16px !important;
    }
    .portal-card {
        padding: 20px;
    }
}
