/* Design System & Variables */
:root {
    --bg-color: #050508;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-cyan: #00f2fe;
    --accent-purple: #9d4edd;
    --accent-green: #10b981;
    
    --card-bg: rgba(13, 13, 23, 0.45);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-hover: rgba(0, 242, 254, 0.25);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --glow-cyan: 0 0 25px rgba(0, 242, 254, 0.15);
    --glow-purple: 0 0 25px rgba(157, 78, 221, 0.15);
    --glow-card-hover: 0 10px 30px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 242, 254, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Ambient Floating Orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: 0;
    opacity: 0.25;
    pointer-events: none;
    animation: drift 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    animation-duration: 25s;
}

.orb-2 {
    bottom: -15%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    animation-duration: 30s;
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.5) 0%, transparent 60%);
    opacity: 0.12;
    animation: pulse-orb 10s infinite alternate ease-in-out;
}

/* Animations */
@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(5%, 10%) scale(1.1);
    }
    100% {
        transform: translate(-5%, -5%) scale(0.9);
    }
}

@keyframes pulse-orb {
    0% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.08;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.15;
    }
}

/* App Wrapper & Layout */
.wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4.5rem;
    min-height: 100vh;
    justify-content: space-between;
}

/* Header Styling */
.header {
    text-align: center;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--bg-color);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite linear;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.logo-text span {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
    max-width: 450px;
}

/* Subdomain Portal Cards Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
    perspective: 1000px;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.2s;
}

/* Card Styling */
.card {
    position: relative;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.25rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Custom CSS Var Blur Fallback */
:root {
    --glass-blur: blur(16px);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 120px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 242, 254, 0.12), transparent 80%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.card:hover .card-glow {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.card-icon-wrapper .icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-active .badge-dot {
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
}

.badge-pending {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-pending .badge-dot {
    background-color: var(--text-muted);
}

/* Card Typography & Text */
.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.action-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.arrow-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card Interactivity */
/* Active Card Hover */
.active-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--card-border-hover);
    box-shadow: var(--glow-card-hover);
}

.active-card:hover .card-icon-wrapper {
    background: rgba(0, 242, 254, 0.07);
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

.active-card:hover .card-icon-wrapper .icon {
    color: var(--accent-cyan);
    transform: scale(1.1);
}

.active-card:hover .card-title {
    color: var(--accent-cyan);
}

.active-card:hover .action-text {
    color: var(--text-primary);
}

.active-card:hover .arrow-icon {
    color: var(--accent-cyan);
    transform: translateX(6px);
}

/* Disabled Card Design */
.disabled-card {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: rgba(10, 10, 15, 0.25);
}

.disabled-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    opacity: 0.7;
}

.disabled-card:hover .card-glow {
    background: radial-gradient(circle 120px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.03), transparent 80%);
    opacity: 1;
}

/* Footer Styling */
.footer {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeIn 1s ease both;
    animation-delay: 0.4s;
}

.footer-divider {
    width: 100%;
    max-width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

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

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

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wrapper {
        padding: 3rem 1.5rem;
        gap: 3rem;
    }
    .logo-text {
        font-size: 1.85rem;
    }
    .subtitle {
        font-size: 0.95rem;
    }
    .grid-container {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 1.75rem;
        min-height: 240px;
    }
}
