/* 
 * Learning Path Planner Styles
 * Theme: Educational Light Mode (Primary: #7c3aed, Success: #10B981)
 */

:root {
    --bg-main: #F8FAFC;
    /* Slate 50 */
    --bg-surface: #FFFFFF;
    --bg-dim: #F1F5F9;
    /* Slate 100 */

    --primary: #7C3AED;
    /* Violet 600 */
    --primary-hover: #6D28D9;
    /* Violet 700 */
    --primary-light: #EDE9FE;
    /* Violet 100 */

    --success: #10B981;
    /* Emerald 500 */
    --success-light: #D1FAE5;

    --warning: #F59E0B;
    /* Amber 500 */
    --warning-light: #FEF3C7;

    --text-main: #0F172A;
    /* Slate 900 */
    --text-muted: #64748B;
    /* Slate 500 */
    --border: #E2E8F0;
    /* Slate 200 */

    --danger: #EF4444;

    --font-main: 'Outfit', system-ui, sans-serif;

    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius: 8px;
    --radius-sm: 4px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(124, 58, 237, 0.1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden {
    display: none !important;
}

.w-full {
    width: 100%;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-orange {
    color: #f97316;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.85rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

.flex-1 {
    flex: 1;
}

.relative {
    position: relative;
}

.scroll-y {
    overflow-y: auto;
}

/* Form layout */
.form-row {
    display: flex;
    gap: 1rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- Layout --- */
.app-container {
    display: flex;
    height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 320px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.logo i {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.4rem;
    border-radius: var(--radius);
}

.streak-box {
    background: var(--bg-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.streak-box i {
    font-size: 1.8rem;
}

.streak-val {
    font-weight: 700;
    font-size: 1.1rem;
}

.streak-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.path-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.path-item {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.path-item:hover {
    background: var(--bg-dim);
}

.path-item.active {
    background: var(--primary-light);
    border-color: rgba(124, 58, 237, 0.2);
    color: var(--primary-hover);
    font-weight: 600;
}

.path-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.path-item-del {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
}

.path-item:hover .path-item-del {
    display: block;
}

.path-item-del:hover {
    color: var(--danger);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-dim);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-dim);
    border-color: var(--text-muted);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-dim);
    color: var(--text-main);
}

.btn-txt-danger {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-txt-danger:hover {
    text-decoration: underline;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--text-main);
    color: white;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* --- Workspace --- */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, var(--primary-light) 0%, transparent 60%);
}

.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    z-index: 5;
    text-align: center;
}

.empty-state .icon-wrap {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.empty-state h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 400px;
}


/* Dashboard */
.path-dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.path-header {
    padding: 2.5rem 3rem 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.path-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

.badge-light {
    background: var(--bg-dim);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.path-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.path-goal {
    color: var(--text-muted);
    font-size: 1rem;
}

.path-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.progress-text {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 100px;
}

/* Tabs */
.view-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.path-content {
    flex: 1;
    padding: 0;
    background: var(--bg-main);
}

.tab-view {
    padding: 2.5rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Curriculum View */
.module-section-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.module-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.module-header {
    background: var(--bg-dim);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.module-badges {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.lesson-list {
    display: flex;
    flex-direction: column;
}

.lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--bg-dim);
    transition: background 0.2s;
}

.lesson-item:hover {
    background: rgba(241, 245, 249, 0.5);
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
    background: white;
}

.lesson-item.status-Complete .checkbox-custom {
    background: var(--success);
    border-color: var(--success);
}

.lesson-item.status-Complete .checkbox-custom::after {
    content: '✓';
    font-weight: bold;
}

.lesson-item.status-InProgress .checkbox-custom {
    border-color: var(--warning);
    border-width: 3px;
}

.lesson-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lesson-title {
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
}

.lesson-item.status-Complete .lesson-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.lesson-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lesson-meta a {
    color: var(--primary);
    text-decoration: none;
}

.lesson-meta a:hover {
    text-decoration: underline;
}

.lesson-actions {
    display: flex;
    gap: 0.5rem;
}

/* Roadmap View */
.roadmap-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    max-width: 100%;
}

/* --- Modals --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(0) scale(1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-sm {
    max-width: 400px;
}

.modal-backdrop.hidden .modal {
    transform: translateY(20px) scale(0.95);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
select {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}