/* Codefinity x Cyberpunk Modern UI - Aegis Atlas Stack */

:root {
    --bg-color-main: #0B0F14; /* Deep Code-Editor Dark */
    --accent-primary: #FF6B00; /* Cybernetic Orange */
    --accent-secondary: #00E5FF; /* Cyber Cyan */
    --accent-tertiary: #B026FF; /* Deep Neon Purple */
    
    --panel-bg: rgba(18, 24, 33, 0.7); /* Sleek translucent dark */
    --panel-border: rgba(255, 107, 0, 0.2); /* Orange tinted structural border */
    --panel-highlight: rgba(255, 255, 255, 0.05);
    
    --text-primary: #F8F9FA;
    --text-secondary: #8B949E; /* Muted tech gray */
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden; /* App feels like a native desktop client */
    height: 100vh;
    width: 100vw;
}

/* Background Cyberpunk Animations */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

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

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 60%);
    top: -10%;
    left: 5%;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 60%);
    bottom: 5%;
    right: 5%;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-tertiary) 0%, transparent 60%);
    bottom: 30%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.1); }
}

/* Glassmorphism/Panel Utilities */
/* Sharper corners (12px) to emulate modern coding platform (Codefinity) instead of typical app (20px) */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Layout Setup */
.app-container {
    display: flex;
    height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    transition: all 0.3s ease;
}

.brand {
    padding: 0 24px;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    color: var(--accent-primary);
    text-shadow: 0 0 15px rgba(255, 107, 0, 0.6); /* Fierce orange glow */
    letter-spacing: 1px;
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px; /* slightly tighter */
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}
.nav-menu::-webkit-scrollbar-thumb {
    background: var(--panel-highlight);
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 8px; /* Tighter code-editor borders */
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 107, 0, 0.12); /* Orange transparent background */
    color: var(--text-primary);
    border-left: 3px solid var(--accent-primary);
}
.nav-item.active i {
    color: var(--accent-primary); /* Icon itself glows orange when active */
}

.nav-divider {
    font-size: 0.70rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.2);
    margin: 24px 0 12px 16px;
    font-weight: 700;
}

.user-profile {
    padding: 20px 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* very subtle divide */
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px; /* Angular avatar instead of pure circle */
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #000; /* Dark icon inside gradient */
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-info .title {
    font-size: 0.75rem;
    color: var(--accent-secondary); /* Cyan accent for title */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.breadcrumbs {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs i {
    font-size: 0.7rem;
    color: var(--accent-primary);
}

.breadcrumbs .current {
    color: var(--text-primary);
    font-weight: 600;
}

.gamification-stats {
    display: flex;
    gap: 16px;
}

.stat-pill {
    background: rgba(0,0,0,0.5); /* Pitch dark inside */
    border: 1px solid rgba(255,255,255,0.08); /* faint rim */
    padding: 8px 16px;
    border-radius: 8px; /* Techy hard edges */
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-pill.streak i { color: #ff3300; } /* pure fire red-orange */
.stat-pill.xp i { color: var(--accent-primary); text-shadow: 0 0 10px rgba(255, 107, 0, 0.6); }
.stat-pill.rank i { color: var(--accent-secondary); }

/* View Container */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 40px 10px;
}
.view-container::-webkit-scrollbar {
    display: none;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease forwards;
}

.view.active {
    display: block;
}

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

.view-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.view-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 30px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.widget {
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Subtle inner vignette shadow for coding platform feel */
.widget::before {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
    z-index: -1;
    border-radius: inherit;
}

.widget.widget-large {
    grid-column: span 2;
}

.widget.widget-wide {
    grid-column: span 3;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05); /* structured bottom border */
    padding-bottom: 12px;
}

.widget-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.widget-header h3 i {
    color: var(--accent-primary);
}

.badge {
    background: rgba(255, 107, 0, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(255, 107, 0, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Specific Widgets */
.module-preview {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(0,0,0,0.4);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 0, 0.1);
}

.module-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e2531, #0f141b);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: var(--accent-secondary); /* cyan icon inside the dark orange box */
}

.module-details {
    flex: 1;
}

.module-details h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.module-details p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
    line-height: 1.4;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.progress-bar {
    height: 6px;
    flex: 1;
    background: rgba(255,255,255,0.05); /* very subtle dark track */
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: inherit;
    background: var(--accent-primary); /* solid orange bar */
    border-radius: 3px;
    box-shadow: 0 0 10px var(--accent-primary);
}

.action-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.glow-effect:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.5); /* Big orange burst */
}

/* Quests */
.quest {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px dashed rgba(255,255,255,0.05); /* tech dashed lines */
}

.quest:first-child {
    border-top: none;
    padding-top: 0;
}

.checkbox {
    width: 22px;
    height: 22px;
    border-radius: 4px; /* Tech box */
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: transparent;
    transition: all 0.2s;
}

.quest.completed .checkbox {
    background: var(--accent-secondary); /* cyan check for contrast */
    border-color: var(--accent-secondary);
    color: #000;
}

.quest.completed .quest-info span:first-child {
    text-decoration: line-through;
    color: rgba(255,255,255,0.3);
}

.quest-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.xp-reward {
    color: var(--accent-primary);
    font-family: monospace; /* code font for reward */
    font-weight: 700;
    font-size: 0.95rem;
}

/* Certifications Grid */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.cert-card {
    background: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start; /* top align */
    gap: 16px;
    border: 1px solid rgba(255,255,255,0.05); /* standard muted border */
    border-left: 3px solid var(--accent-secondary); /* cyan accent edge */
    transition: transform 0.2s, border-color 0.2s;
}

.cert-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.1);
}

.cert-card i {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.cert-info h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.progress-mini {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-bottom: 8px;
}

.progress-mini .fill {
    height: 100%;
    background: var(--accent-secondary); /* cyan progress */
    border-radius: 2px;
}

.cert-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace; /* coding aesthetic */
}

/* Construction Zones via JS */
.temp-view-content {
    background: rgba(0,0,0,0.3);
    border: 1px dashed var(--accent-primary); /* orange dashed outline */
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
}

.temp-view-content i {
    font-size: 4rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
    opacity: 0.8;
}

.temp-view-content h2 {
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.temp-view-content p {
    color: var(--text-secondary);
    max-width: 400px;
}

/* INTERACTIVE LABS VIEW (Codefinity Style Split Pane) */
.lab-workspace {
    display: flex;
    gap: 16px;
    height: calc(100vh - 160px); /* Fill remaining space exactly */
    animation: fadeIn 0.4s ease;
}

/* Left Pane: Instructions & Tutor */
.lab-sidebar {
    width: 35%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lab-instructions {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-badge {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-badge span:first-child {
    color: var(--accent-secondary);
}

.header-badge .level {
    color: #ffd343;
}

.lab-instructions h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.lab-instructions .objective {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.lab-instructions code {
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-primary);
    font-family: monospace;
}

.task-list {
    list-style: none;
}

.task-list li {
    padding: 8px 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.task-list li i {
    color: var(--text-secondary);
}

/* AI Tutor Chat Panel */
.ai-tutor-panel {
    height: 40%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.3);
}

.tutor-header {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutor-chat-window {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tutor-msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tutor-msg .avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
}

.msg-ai .avatar {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.msg-ai .bubble {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 0 8px 8px 8px;
}

.msg-user {
    flex-direction: row-reverse;
}

.msg-user .avatar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
}

.msg-user .bubble {
    background: rgba(255, 107, 0, 0.1);
    border: 1px solid rgba(255, 107, 0, 0.2);
    border-radius: 8px 0 8px 8px;
}

.bubble {
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
    max-width: 85%;
}

.bubble code {
    background: rgba(0,0,0,0.5);
    padding: 0 4px;
    border-radius: 3px;
    font-family: monospace;
    color: var(--accent-primary);
}

.tutor-input {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    gap: 8px;
}

.tutor-input input {
    flex: 1;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-family: var(--font-body);
}

.tutor-input input:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

.tutor-input button {
    background: var(--accent-secondary);
    color: #000;
    border: none;
    width: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

.tutor-input button:hover {
    background: white;
}

/* Right Pane: Code Editor & Terminal */
.lab-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0 16px;
    background: rgba(0,0,0,0.2);
}

.tabs {
    display: flex;
    height: 100%;
}

.tab {
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-family: monospace;
    color: var(--text-secondary);
    border-right: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    height: 100%;
}

.tab.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
    background: rgba(255,255,255,0.02);
}

.tab i {
    color: #3776ab; /* python blue */
}

.editor-header .actions {
    display: flex;
    gap: 12px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

.action-btn.outline {
    border-color: rgba(255,255,255,0.2);
    color: var(--text-primary);
}

.action-btn.outline:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(0, 229, 255, 0.1);
    box-shadow: none;
}

/* Code Area (Mock Monaco) */
.code-editor-area {
    flex: 1;
    background: #0B0F14; /* Pure dark for coding */
    padding: 16px;
    overflow: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-editor-area pre {
    margin: 0;
}

.code-editor-area .kw { color: #FF7B72; } /* Keywords */
.code-editor-area .str { color: #A5D6FF; } /* Strings */
.code-editor-area .num { color: #79C0FF; } /* Numbers */
.code-editor-area .func { color: #D2A8FF; } /* Functions */
.code-editor-area .comment { color: #8B949E; font-style: italic; } /* Comments */

/* Terminal Area */
.terminal-area {
    height: 30%;
    min-height: 200px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

.term-header {
    padding: 8px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.term-content {
    flex: 1;
    background: #05070a;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #00FF00; /* Hacker green terminal */
    overflow-y: auto;
    line-height: 1.5;
}
