/* --- Reset & Global Variables --- */
:root {
    --bg-base: #060913;
    --bg-surface: rgba(13, 20, 42, 0.45);
    --bg-surface-hover: rgba(18, 28, 59, 0.65);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-hover: rgba(0, 242, 254, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-glow: rgba(0, 242, 254, 0.15);
    
    --tag-active: #10b981;
    --tag-active-glow: rgba(16, 185, 129, 0.2);
    --tag-soon: #f59e0b;
    --tag-soon-glow: rgba(245, 158, 11, 0.15);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* --- Futuristic Command Grid Background --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.007) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.007) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
    pointer-events: none;
    z-index: 0;
}

/* --- Ambient Background Glows --- */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    top: -100px;
    right: -50px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: var(--bg-base);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.logo-text .accent-text {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator-dot.online {
    background-color: var(--tag-active);
    box-shadow: 0 0 10px var(--tag-active);
}

.status-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- Hero Section --- */
.hero-section {
    padding: 5rem 0 0.5rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.7;
}

/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(18, 28, 59, 0.55);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.active-badge {
    background: var(--tag-active-glow);
    color: var(--tag-active);
}

.live-badge {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
}

.good-badge {
    background: rgba(79, 172, 254, 0.1);
    color: var(--accent-blue);
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Portals Navigation Section --- */
.portals-section {
    padding: 1rem 0 6rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* --- Portals Grid --- */
.portals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .portals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .portals-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Portal Cards --- */
.portal-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-card:hover {
    transform: translateY(-6px);
    background: var(--bg-surface-hover);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.portal-card.active-portal:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.portal-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-icon {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
}

.doctor-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tag-active);
}

.sales-icon {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.caller-icon {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.dietitian-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tag-soon);
}

.fitness-icon {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.portal-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.active-tag {
    background: var(--tag-active-glow);
    color: var(--tag-active);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.soon-tag {
    background: var(--tag-soon-glow);
    color: var(--tag-soon);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.portal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.portal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.portal-features {
    list-style: none;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.portal-features li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-features li::before {
    content: "•";
    color: var(--accent-cyan);
    font-weight: bold;
}

.idle-portal .portal-features li::before {
    color: var(--tag-soon);
}

/* --- Action Buttons --- */
.portal-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: var(--bg-base);
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.2);
}

.btn-active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 242, 254, 0.4);
}

.btn-soon {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-soon:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 650px) {
    .footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-secondary);
}

/* --- Premium Animation States & Glow Overrides --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portals-section {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Enhancing card transitions and interactive borders */
.portal-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.3s ease, 
                border-color 0.3s ease, 
                box-shadow 0.3s ease;
}

.portal-card.active-portal:hover {
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 242, 254, 0.15);
}

.portal-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.portal-btn.btn-active:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.5);
}

