/* ===============================
   ROADMAPS MODULE - FULL WIDTH, LEFT ALIGNED
   =============================== */

/* --- Import Ubuntu Font --- */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');

/* --- Base Typography --- */
body {
    font-family: 'Ubuntu', sans-serif;
}

.roadmap-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 1rem 1rem;   /* reduced left/right gap */
    align-items: flex-start;
}

/* --- Tabs Navigation --- */
.roadmap-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    font-family: 'Ubuntu', sans-serif;   /* ✅ force Ubuntu on nav */
}
.roadmap-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
    background: transparent;
    transition: all 0.25s ease;
    text-align: center;
    font-family: 'Ubuntu', sans-serif;   /* ✅ tabs text Ubuntu */
}
.roadmap-tab:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.roadmap-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    box-shadow: var(--shadow-sm);
}


#back-to-gallery {
    font-family: 'Ubuntu', sans-serif;   /* ✅ back button Ubuntu */
    font-weight: 500;
}

/* --- Sections --- */
.roadmap-sections {
    flex: 1;
    overflow-y: auto;
    width: 100%;
}
.roadmap-category-section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 100%;
}
.roadmap-category-section.active {
    display: block;
    opacity: 1;
}
.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    width: 100%;
}

/* --- Roadmap Cards --- */
.roadmap-card {
    background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--primary) 5%, var(--surface)));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.roadmap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
}
.roadmap-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: var(--primary);
}
.roadmap-card:hover::before {
    left: 100%;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
}
.card-icon-wrapper {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg);
    color: var(--primary);
}
.difficulty-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
}
.difficulty-tag.beginner { 
    background: linear-gradient(135deg, #10b981, #059669); 
    color: #fff; 
    box-shadow: 0 2px 6px rgba(16,185,129,.3);
}
.difficulty-tag.intermediate { 
    background: linear-gradient(135deg, #f59e0b, #d97706); 
    color: #fff; 
    box-shadow: 0 2px 6px rgba(245,158,11,.3);
}
.difficulty-tag.advanced { 
    background: linear-gradient(135deg, #ef4444, #dc2626); 
    color: #fff; 
    box-shadow: 0 2px 6px rgba(239,68,68,.3);
}
.difficulty-tag.expert { 
    background: linear-gradient(135deg, #a78bfa, #8b5cf6); 
    color: #fff; 
    box-shadow: 0 2px 6px rgba(167,139,250,.3);
}
.difficulty-tag.master { 
    background: linear-gradient(135deg, #22d3ee, #06b6d4); 
    color: #fff; 
    box-shadow: 0 2px 6px rgba(34,211,238,.3);
}

.card-body {
    padding: 0 0.75rem 0.75rem;
}
.card-body h2 {
    font-size: 1rem;
    margin: 0 0 0.3rem 0;
    color: var(--text);
}
.card-body p {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}

.card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}
.info-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    background: var(--bg);
    padding: 0.3rem 0.5rem;
    border-radius: 999px;
    color: var(--muted);
}

.roadmap-progress {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.progress-bar-sm {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-right: 0.5rem;
}
.progress-sm {
    height: 100%;
    background: var(--primary);
    transition: width 0.4s ease;
    border-radius: 4px;
}
.roadmap-progress span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Roadmap Detail View --- */
.roadmap-detail-view {
    width: 100%;
    padding: 1rem 1rem;   /* reduced left/right gap */
}
.roadmap-detail-header {
    display: flex;
    gap: 1rem;
    background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--primary) 8%, var(--surface)));
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    align-items: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}
.roadmap-detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--primary-strong));
}
.header-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--bg);
    font-size: 1.1rem;
}
.header-content h1 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
}
.header-content p {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.3;
}
.header-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.header-stats .info-chip {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}
.header-progress {
    margin-left: auto;
    text-align: center;
}
.progress-circle {
    --size: 64px;
    width: var(--size);
    height: var(--size);
    position: relative;
}
.progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.progress-circle circle {
    fill: none;
    stroke-width: 6;
    r: 30;
    cx: 32;
    cy: 32;
}
.progress-circle .bg { stroke: var(--border); }
.progress-circle .fg {
    stroke: var(--primary);
    stroke-dasharray: 188;
    stroke-dashoffset: calc(188 - (188 * var(--progress-value)) / 100);
    transition: stroke-dashoffset 0.6s ease;
}
.progress-circle span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
}
.progress-label {
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--muted);
}

/* --- Stages --- */
.roadmap-stages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}
.stage {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    width: 100%;
}
.stage-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
}
.stage.completed .stage-icon { background: var(--success-light); color: var(--success); }
.stage.in-progress .stage-icon { background: var(--warning-light); color: var(--warning); }
.stage.locked .stage-icon { background: var(--border); color: var(--muted); }

.stage-content {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* --- Quiz Chips --- */
.quiz-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.quiz-chip-container {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}
.quiz-chip-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.quiz-chip-main {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.quiz-chip-main .completion-icon {
    margin-left: auto;
    color: var(--success);
}
.quiz-title {
    font-weight: 600;
    font-size: 0.85rem;
}
.quiz-chip-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.3rem;
}
.quiz-progress-bar {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}
.quiz-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}
.quiz-progress-text {
    font-size: 0.7rem;
    color: var(--muted);
}
.quiz-chip-container.completed {
    border-color: var(--success);
    background: var(--success-light);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .roadmap-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-progress {
        margin-left: 0;
        margin-top: 0.75rem;
    }
    .quiz-list {
        grid-template-columns: 1fr;
    }
}
