:root {
    --sage-light: #f0f4f0;
    --sage-medium: #b2c2b2;
    --sage-dark: #7a8a7a;
    --whale-blue: #2c3e50;
    --whale-dark: #1a252f;
    --accent: #e67e22;
    --success: #27ae60;
    --text-color: #34495e;
    --bg-color: #f9fbfa;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* View Management */
.view {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

.view.active {
    display: flex;
    flex-direction: column;
}

#workspace-view.active {
    flex-direction: row;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Home View / Hero */
.hero {
    background: linear-gradient(135deg, var(--whale-blue) 0%, var(--whale-dark) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--sage-medium);
}

.tagline {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.mission-card {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Module Selection */
.module-selection {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.module-selection h2 {
    margin-bottom: 3rem;
    font-size: 2rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

@media (min-width: 992px) {
    .modules-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.module-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.module-card.active-module:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--sage-medium);
}

.module-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
}

.module-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.module-card h3 {
    margin-bottom: 1rem;
}

.difficulty {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.3rem 0.8rem;
    background: var(--sage-light);
    color: var(--sage-dark);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--whale-blue);
    color: white;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.brand {
    cursor: pointer;
    transition: var(--transition);
}

.brand:hover {
    opacity: 0.8;
    transform: translateX(-5px);
}

.brand h1 {
    font-size: 2rem;
    color: var(--sage-medium);
}

.user-profile {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin: 0.8rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sage-medium), #fff);
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.badge {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.badge.unlocked {
    background: var(--sage-medium);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(178, 194, 178, 0.4);
}

.badge.locked {
    filter: grayscale(1);
    opacity: 0.2;
}

/* Workspace */
.workspace {
    flex: 1;
    padding: 3rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stage-indicator {
    display: flex;
    gap: 0.8rem;
}

.stage {
    padding: 0.4rem 1.2rem;
    background: #eee;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    transition: var(--transition);
}

.stage.active {
    background: var(--whale-blue);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tutor-bubble {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    border-bottom-left-radius: 4px;
    box-shadow: var(--card-shadow);
    border-left: 8px solid var(--sage-medium);
    font-size: 1.2rem;
    line-height: 1.8;
}

.tutor-highlight {
    color: var(--sage-dark);
    font-weight: 800;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Math Card */
.math-card {
    background: white;
    padding: 4rem;
    border-radius: 30px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

#current-expression {
    font-size: 3.5rem;
    color: var(--whale-blue);
    font-weight: 600;
}

#task-figure {
    animation: fadeIn 0.8s ease;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.05));
}

#task-figure svg {
    max-width: 100%;
    height: auto;
}

/* Options */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.option-btn {
    background: white;
    border: 3px solid #f0f0f0;
    padding: 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    font-size: 1.1rem;
    color: var(--whale-blue);
    font-weight: 600;
}

.option-btn:hover {
    border-color: var(--sage-medium);
    background: var(--sage-light);
    transform: translateY(-5px);
}

.option-btn.selected {
    background: var(--sage-medium);
    color: white;
    border-color: var(--sage-medium);
}

.hint-card {
    background: #fff8e1;
    padding: 1.2rem;
    border-radius: 12px;
    border-left: 5px solid var(--accent);
    margin-bottom: 2rem;
    animation: slideIn 0.4s ease;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 4rem;
    border-radius: 40px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
}

.primary-btn {
    background: var(--whale-blue);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(44, 62, 80, 0.3);
}

.secondary-btn {
    background: #f0f0f0;
    color: var(--whale-blue);
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.badge-guide {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-guide h4 {
    color: var(--sage-medium);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.badge-guide p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.badge-guide ul {
    list-style: none;
    font-size: 0.85rem;
}

.badge-guide li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-guide strong {
    color: white;
}

/* Footer Styling */
.main-footer {
    padding: 3rem 2rem;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: auto;
    width: 100%;
    z-index: 50;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.copyright {
    color: #888;
    font-size: 0.9rem;
}

.copyright a {
    color: var(--whale-blue);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.copyright a:hover {
    color: var(--accent);
}

.footer-magic {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #bbb;
    margin-bottom: 1rem;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.8rem;
    background: var(--sage-light);
    color: var(--whale-blue);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.home-link:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--whale-blue);
    color: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.home-link i {
    color: var(--accent);
}