/* ==========================================================================
   AI Study Baseline - Roadmap Tab CSS (Trilhas de Aprendizado)
   Premium responsive layouts, glowing vertical steppers, and adaptive colors.
   ========================================================================== */

/* --- Main Layout --- */
.roadmaps-view-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    animation: tabReveal var(--transition-slow) forwards;
    width: 100%;
}

/* --- Persona Selection Grid --- */
.roadmaps-personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.persona-select-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-main);
}

.persona-select-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: hsl(var(--p-accent));
    opacity: 0.4;
    transition: opacity var(--transition-normal), height var(--transition-normal);
}

.persona-select-card:hover {
    transform: translateY(-5px);
    border-color: hsla(var(--p-accent), 0.3);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 0 16px -2px hsla(var(--p-accent), 0.15);
    background: var(--bg-card-hover);
}

body.dark-theme .persona-select-card:hover {
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4), 0 0 20px -2px hsla(var(--p-accent), 0.25);
}

.persona-select-card.active-persona {
    border-color: hsl(var(--p-accent));
    background: var(--bg-card-hover);
    box-shadow: 0 12px 30px -10px hsla(var(--p-accent), 0.12);
}

.persona-select-card.active-persona::before {
    height: 6px;
    opacity: 1;
}

.persona-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.persona-icon-container {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    background: hsla(var(--p-accent), 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid hsla(var(--p-accent), 0.15);
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.persona-select-card:hover .persona-icon-container {
    transform: scale(1.1) rotate(5deg);
}

.persona-title-area {
    display: flex;
    flex-direction: column;
}

.persona-title-area h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.persona-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

.persona-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.persona-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-glow);
}

.persona-stats {
    font-size: 0.775rem;
    font-weight: 700;
    color: hsl(var(--p-accent));
    background: hsla(var(--p-accent), 0.06);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    border: 1px solid hsla(var(--p-accent), 0.1);
}

.persona-action-hint {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.persona-select-card:hover .persona-action-hint {
    color: hsl(var(--p-accent));
    transform: translateX(3px);
}

.persona-select-card.active-persona .persona-action-hint {
    color: hsl(var(--p-accent));
}

/* --- Active Roadmap Header Panel --- */
.active-roadmap-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    box-shadow: var(--shadow-main);
    border-left: 5px solid hsl(var(--current-accent));
}

.active-roadmap-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.active-roadmap-icon {
    font-size: 2.5rem;
}

.active-roadmap-title-row h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 850;
    color: var(--text-primary);
}

.active-roadmap-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 900px;
    font-size: 1rem;
}

/* --- Vertical Stepper Timeline --- */
.roadmap-timeline {
    position: relative;
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 100%;
}

/* Timeline axis vertical line */
.roadmap-timeline::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 8px;
    width: 2px;
    background: linear-gradient(to bottom, 
        hsl(var(--current-accent)) 0%, 
        hsla(var(--current-accent), 0.4) 60%, 
        rgba(255, 255, 255, 0) 100%
    );
    z-index: 1;
}

.timeline-phase-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Timeline node/dot on the line */
.phase-node {
    position: absolute;
    left: -2rem;
    top: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 3.5px solid hsl(var(--current-accent));
    z-index: 2;
    box-shadow: 0 0 0 4px var(--bg-base);
    transition: all var(--transition-normal);
}

/* Pulse animation on active/critical nodes */
.urgency-critico .phase-node {
    animation: node-pulse-red 2s infinite ease-in-out;
}

@keyframes node-pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4), 0 0 0 4px var(--bg-base); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0), 0 0 0 4px var(--bg-base); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 0 0 4px var(--bg-base); }
}

.phase-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

.phase-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Urgency pill badges */
.urgency-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.65rem;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.urgency-critico .urgency-badge {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.18);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.05);
}

.urgency-alto .urgency-badge {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.urgency-medio .urgency-badge {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.18);
}

.urgency-recomendavel .urgency-badge {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.18);
}

.urgency-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.urgency-critico .urgency-badge::before {
    animation: flash 1.5s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* --- Timeline Steps Grid --- */
.phase-steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding-left: 0.5rem;
    width: 100%;
}

@media (min-width: 900px) {
    .phase-steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Individual Step Cards */
.roadmap-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    box-shadow: var(--shadow-main);
    transition: all var(--transition-normal);
    position: relative;
}

.roadmap-step-card:hover {
    transform: translateY(-3px);
    border-color: hsla(var(--current-accent), 0.25);
    background: var(--bg-card-hover);
    box-shadow: 0 12px 25px -8px rgba(0, 0, 0, 0.05);
}

body.dark-theme .roadmap-step-card:hover {
    box-shadow: 0 12px 25px -10px rgba(0, 0, 0, 0.35);
}

.step-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.step-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.step-module-tag {
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.step-card-header h4 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.step-id {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 800;
    color: hsl(var(--current-accent));
    background: hsla(var(--current-accent), 0.06);
    border: 1px solid hsla(var(--current-accent), 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.step-rationale {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    background: rgba(15, 23, 42, 0.015);
    border-left: 3px solid hsla(var(--current-accent), 0.25);
    padding: 0.5rem 0 0.5rem 0.75rem;
}

body.dark-theme .step-rationale {
    background: rgba(255, 255, 255, 0.01);
}

.step-action-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Ver Conceito deep link button */
.btn-step-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: hsl(var(--current-accent));
    background: hsla(var(--current-accent), 0.06);
    border: 1px solid hsla(var(--current-accent), 0.12);
    padding: 0.45rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-step-link:hover {
    background: hsl(var(--current-accent));
    color: #ffffff !important;
    border-color: hsl(var(--current-accent));
    box-shadow: 0 4px 12px -2px hsla(var(--current-accent), 0.3);
}

.btn-step-link .btn-arrow {
    transition: transform var(--transition-fast);
}

.btn-step-link:hover .btn-arrow {
    transform: translateX(3px);
}

/* --- Neon Concept Card Highlight --- */
@keyframes concept-highlight-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.8), var(--shadow-main);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px 10px rgba(234, 179, 8, 0.45), var(--shadow-main);
        transform: scale(1.025);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0), var(--shadow-main);
        transform: scale(1);
    }
}

.concept-card.concept-card-highlight {
    animation: concept-highlight-glow 2.2s infinite ease-in-out;
    border-color: #eab308 !important;
    border-width: 1.5px !important;
    z-index: 10;
}
