:root {
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-1: #3b82f6; /* Blueish */
    --accent-2: #8b5cf6; /* Purplish */
    --accent-3: #ec4899; /* Pinkish */
    
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-hover-bg: rgba(30, 41, 59, 0.6);
    --card-hover-border: rgba(255, 255, 255, 0.2);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    /* Subtle background grid */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Dynamic Animated Background Globes */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    filter: blur(100px);
    opacity: 0.6;
}

.globe {
    position: absolute;
    border-radius: 50%;
    animation: float 20s infinite alternate ease-in-out;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
    top: -100px;
    left: 10%;
    animation-delay: 0s;
}

.globe-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
    bottom: -150px;
    right: 5%;
    animation-delay: -5s;
}

.globe-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--accent-3), transparent 70%);
    top: 30%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -50px) scale(1.1); }
    100% { transform: translate(-30px, 30px) scale(0.9); }
}

/* Layout Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 0.8s ease-out forwards;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    flex: 1;
}

/* App Card - Glassmorphism */
.app-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
    cursor: pointer;
}

/* Stagger card animations dynamically in JS or with child selectors */
.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }

/* Glow effect on hover */
.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.app-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.app-card:hover::before {
    left: 200%;
}

.app-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 10px;
    transition: var(--transition);
}

.app-card:hover .app-icon-wrapper {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1) rotate(5deg);
}

.app-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* Fallback icon if no image provided */
.app-icon-fallback {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.app-link-text {
    font-size: 0.9rem;
    color: var(--accent-1);
    opacity: 0.8;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.app-card:hover .app-link-text {
    opacity: 1;
    color: var(--accent-2);
}

.app-link-text::after {
    content: '→';
    transition: transform 0.3s ease;
}

.app-card:hover .app-link-text::after {
    transform: translateX(5px);
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    opacity: 0.5;
}

.admin-link:hover {
    color: var(--text-primary);
    opacity: 1;
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    .app-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }
}
