:root {
    --primary-color: #158C18;
    --primary-dark: #0e6311;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #6c757d;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 10px 20px rgba(21, 140, 24, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f0f2f5;
    background-image: linear-gradient(135deg, #e0f2e1 0%, #f0f2f5 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.5;
}

/* Header */
.main-header {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    /* In case it becomes a link */
}

.school-logo {
    height: 50px;
    width: auto;
}

.school-name {
    display: flex;
    flex-direction: column;
}

.school-name h1 {
    font-size: 1.125rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.school-name span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Running Text */
.news-ticker {
    background: var(--primary-color);
    color: var(--white);
    overflow: hidden;
    padding: 0.75rem 0;
    position: relative;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
}

.ticker-content {
    display: inline-block;
    animation: ticker 35s linear infinite;
    padding-left: 100%;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Main Portal Grid */
.portal-container {
    max-width: 1200px;
    width: 100%;
    margin: 3rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

/* Neon Colors Configuration */
.cards-grid .portal-card:nth-child(1) {
    --neon-color: #00fa9a;
    --card-color: #00c853;
}

/* Spring Green */
.cards-grid .portal-card:nth-child(2) {
    --neon-color: #00e5ff;
    --card-color: #00bcd4;
}

/* Cyan */
.cards-grid .portal-card:nth-child(3) {
    --neon-color: #ff4081;
    --card-color: #e91e63;
}

/* Pink */
.cards-grid .portal-card:nth-child(4) {
    --neon-color: #ff9100;
    --card-color: #ff9800;
}

/* Orange */
.cards-grid .portal-card:nth-child(5) {
    --neon-color: #7c4dff;
    --card-color: #673ab7;
}

/* Deep Purple */
.cards-grid .portal-card:nth-child(6) {
    --neon-color: #ff1744;
    --card-color: #f44336;
}

/* Red */
.cards-grid .portal-card:nth-child(7) {
    --neon-color: #2979ff;
    --card-color: #2196f3;
}

/* Blue */
.cards-grid .portal-card:nth-child(8) {
    --neon-color: #ffea00;
    --card-color: #fdd835;
}

/* Yellow */

.portal-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* ... existing code ... */

/* Neon Effects */
.cards-grid .portal-card:nth-child(1) {
    --neon-color: #00ff00;
    --card-color: #158C18;
}

.cards-grid .portal-card:nth-child(2) {
    --neon-color: #00ffff;
    --card-color: #00bcd4;
}

.cards-grid .portal-card:nth-child(3) {
    --neon-color: #ff00ff;
    --card-color: #e91e63;
}

.cards-grid .portal-card:nth-child(4) {
    --neon-color: #ff9900;
    --card-color: #ff9800;
}

.cards-grid .portal-card:nth-child(5) {
    --neon-color: #00ccff;
    --card-color: #2196f3;
}

.cards-grid .portal-card:nth-child(6) {
    --neon-color: #ff3333;
    --card-color: #f44336;
}

.cards-grid .portal-card:nth-child(7) {
    --neon-color: #cc00ff;
    --card-color: #9c27b0;
}

.cards-grid .portal-card:nth-child(8) {
    --neon-color: #ffff00;
    --card-color: #ffeb3b;
}

.portal-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    /* Always show the colored border */
    border: 2px solid var(--card-color, rgba(0, 0, 0, 0.1));
    /* Add a subtle default glow */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* Override default card icon/header colors with specific card color */
.portal-card .card-icon {
    color: var(--card-color, var(--primary-color));
    background: rgba(var(--card-color-rgb, 21, 140, 24), 0.1);
    /* fallback needed or use color-mix */
}

/* Better compatibility background for icon: Use opacity on the color variable if possible, 
   but since vars are hex, we'll stick to a white bg with colored icon, or generic light bg.
   Let's keep the simple light green background but change icon color? 
   Or better: white icon on colored background on hover?
   Let's just change the icon text color to match the neon theme.
*/
.portal-card .card-icon {
    background: var(--secondary-color);
    color: var(--card-color, var(--primary-color));
    border: 1px solid var(--card-color, transparent);
    /* visual coherence */
}

.portal-card::before {
    background: var(--card-color, var(--primary-color));
}

.portal-card:hover,
.portal-card.mobile-hover {
    transform: translateY(-5px);
    /* Stronger glow on hover */
    box-shadow: 0 0 20px var(--neon-color), 0 0 60px var(--neon-color);
    border-color: var(--neon-color);
    z-index: 10;
}

.portal-card:hover .card-icon,
.portal-card.mobile-hover .card-icon {
    background: var(--card-color, var(--primary-color));
    color: var(--white);
    box-shadow: 0 0 15px var(--neon-color);
}

/* ... existing responsive code ... */


.card-icon svg {
    width: 32px;
    height: 32px;
}

.portal-card h3 {
    font-size: 1.15rem;
    color: #1a1a1a;
    font-weight: 600;
    margin: 0;
}

.portal-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section p {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

/* AI Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.chat-toggle {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(21, 140, 24, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.chat-toggle:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .school-name h1 {
        font-size: 1rem;
    }

    .portal-container {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 Columns for smaller cards */
        gap: 1rem;
    }

    /* Smaller Card Styling for Mobile */
    .portal-card {
        padding: 1.25rem;
        gap: 0.5rem;
    }

    .card-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.25rem;
    }

    .card-icon svg {
        width: 24px;
        height: 24px;
    }

    .portal-card h3 {
        font-size: 0.95rem;
    }

    .portal-card p {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    /* Neon Glow on touch for mobile */
    .cards-grid .portal-card:active {
        box-shadow: 0 0 25px var(--neon-color, rgba(0, 0, 0, 0.1));
        border-color: var(--neon-color, #ccc);
        transform: scale(0.95);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section p {
        justify-content: center;
    }

    .chat-widget {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}