:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --card-bg: rgba(30, 41, 59, 0.65);
    --card-border: rgba(255, 255, 255, 0.12);
    --border-radius: 20px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.home-page {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
}

.home-page .container {
    width: 100%;
    max-width: 1200px;
    padding: 30px;
}

.home-wrapper {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-page .header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.home-page .header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #a5b4fc 0%, #ffffff 50%, #f472b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 4px 20px rgba(99, 102, 241, 0.2));
}

.home-page .header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0.8;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
    perspective: 1000px;
}

.module-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 280px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.3),
        0 8px 10px -6px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transform-style: preserve-3d;
}

.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Mouse tracking requires JS, so we use a simpler gradient but keep the class name for potential future JS */
    background: radial-gradient(800px circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

.module-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.module-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(99, 102, 241, 0.2);
}

.module-card:hover::before,
.module-card:hover::after {
    opacity: 1;
}

.card-icon {
    font-size: 40px;
    margin-bottom: 24px;
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(167, 139, 250, 0.1) 100%);
    color: #a5b4fc;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    z-index: 2;
    position: relative;
}

.module-card:hover .card-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    transform: rotateY(180deg);
}

.module-card:hover .card-icon i {
    transform: rotateY(-180deg); /* Counteract icon rotation */
    display: inline-block;
    transition: transform 0.4s;
}

.module-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
    z-index: 2;
    background: linear-gradient(to right, #fff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
}

.module-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
    line-height: 1.6;
    z-index: 2;
    flex-grow: 1;
}

.card-arrow {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    z-index: 2;
    width: 100%;
}

.module-card:hover .card-arrow {
    color: #a5b4fc;
    padding-left: 8px;
}

.card-arrow::after {
    content: '\F135'; /* Bootstrap Icon arrow-right */
    font-family: 'bootstrap-icons';
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

.module-card:hover .card-arrow::after {
    opacity: 1;
    transform: translateX(0);
}

/* Entry Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation */
.module-card:nth-child(1) { animation: fadeInUp 0.6s ease 0.1s backwards; }
.module-card:nth-child(2) { animation: fadeInUp 0.6s ease 0.2s backwards; }
.module-card:nth-child(3) { animation: fadeInUp 0.6s ease 0.3s backwards; }

@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }
    .home-page .header h1 {
        font-size: 2.5rem;
    }
}
