:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: #e2e8f0;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0) 0, transparent 50%);
    background-color: #f1f5f9;
    color: var(--dark);
    height: 100vh;
    overflow: hidden;
}

/* Decor shapes in background */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
}
body::before {
    width: 400px;
    height: 400px;
    background: #c7d2fe;
    top: -100px;
    left: -100px;
}
body::after {
    width: 300px;
    height: 300px;
    background: #fbcfe8;
    bottom: -50px;
    right: -50px;
}

.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    box-shadow: 2px 0 15px rgba(0,0,0,0.03);
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.logo i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--gray);
    font-size: 0.9rem;
    padding-left: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item i {
    width: 20px;
    text-align: center;
    color: var(--gray);
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(79, 70, 229, 0.08);
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-item.active i {
    color: white;
}

.sidebar-footer {
    text-align: center;
    color: var(--gray);
    font-size: 0.8rem;
    margin-top: auto;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-view {
    display: none;
    padding: 3rem;
    height: 100%;
    overflow-y: auto;
}

.content-view.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

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

.top-bar {
    margin-bottom: 3rem;
}

.top-bar h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.top-bar p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.module-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.module-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.15);
    background: rgba(255, 255, 255, 0.9);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.module-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.module-card p {
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.btn-start {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
}

.module-card:hover .btn-start {
    background: var(--primary);
    color: white;
}

/* Iframe */
.module-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: none;
    background: white; /* Optional, helps with apps that don't have bg */
}

.module-frame.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .sidebar-header {
        margin-bottom: 1rem;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
        gap: 1rem;
    }

    .nav-section {
        display: none;
    }

    .nav-item {
        white-space: nowrap;
        padding: 8px 12px;
    }
    
    .sidebar-footer {
        display: none;
    }

    .content-view {
        padding: 1.5rem 1rem;
    }

    .top-bar h1 {
        font-size: 1.8rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}
