:root {
    --bg-color: #f7f9fc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.1);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --primary-color: #3182ce;
    --primary-hover: #2b6cb0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    color: var(--text-primary);
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
}

.app-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 4rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    text-align: center;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 1200px;
}

.app-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    align-items: start;
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.module-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.module-card.expanded {
    box-shadow: 0 10px 20px var(--shadow-hover);
    border-color: var(--primary-color);
}

.module-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--card-bg);
    user-select: none;
    transition: background-color 0.2s ease;
}

.module-header:hover {
    background: #fbfcfd;
}

.module-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.module-toggle-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.module-card.expanded .module-toggle-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.apps-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    padding: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    background: #fcfdfe;
    border-top: 1px solid var(--border-color);
    transition: all 0.4s ease-in-out;
}

.module-card.expanded .apps-container {
    padding: 2rem;
    max-height: 2000px; /* arbitrary large value for transition */
    opacity: 1;
}

.app-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--shadow-hover);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .app-header {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .module-header {
        padding: 1rem 1.5rem;
    }
    
    .module-card.expanded .apps-container {
        padding: 1rem;
    }
}


.app-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.app-card p {
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
}

.app-card .btn {
    background: var(--bg-color);
    color: var(--primary-color);
    border: 1px solid #cbd5e0;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: auto;
}

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