/* Enhanced Features CSS - FIXED INTERACTION ISSUES */

/* ===== Ripple Effect ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
    /* FIX: Ensure ripple doesn't block clicks */
    pointer-events: none;
    z-index: 1;
}

.ripple:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* ===== Card Hover Animations ===== */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* FIX: Ensure cards don't block underlying elements */
    position: relative;
    z-index: 2;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== Loading Skeletons ===== */
.skeleton-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* FIX: Don't block content */
    pointer-events: none;
}

.skeleton-line {
    height: 20px;
    background: linear-gradient(90deg, 
        rgba(30, 41, 59, 0.1) 25%, 
        rgba(30, 41, 59, 0.3) 50%, 
        rgba(30, 41, 59, 0.1) 75%);
    border-radius: 4px;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ===== Project Roadmap Visualizer ===== */
.roadmap-container {
    margin-top: 30px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid var(--border-color);
    /* FIX: Ensure proper stacking */
    position: relative;
    z-index: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.status-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status-filter-btn {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    /* FIX: Ensure buttons are clickable */
    position: relative;
    z-index: 3;
}

.status-filter-btn:hover {
    background: var(--card-hover);
    color: var(--text-primary);
}

.status-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Milestone Timeline */
.milestone-timeline {
    position: relative;
    padding: 30px 0;
    margin-bottom: 40px;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 40px;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    z-index: 1;
    /* FIX: Don't block clicks */
    pointer-events: none;
}

.milestone-items {
    position: relative;
    z-index: 2;
}

.milestone-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    /* FIX: Ensure proper stacking */
    position: relative;
    z-index: 2;
}

.milestone-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.milestone-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    margin-right: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
}

.milestone-item.completed .milestone-dot {
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.2);
}

.milestone-item.in-progress .milestone-dot {
    background: var(--primary-color);
    animation: pulse-dot 2s infinite;
    box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.7);
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

.milestone-content {
    flex: 1;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease;
    /* FIX: Ensure content doesn't block */
    position: relative;
    z-index: 2;
}

.milestone-content:hover {
    transform: translateX(5px);
    background: var(--card-hover);
}

.milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.milestone-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.milestone-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-not-started {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.status-in-progress {
    background: rgba(248, 150, 30, 0.2);
    color: var(--warning-color);
}

.status-completed {
    background: rgba(76, 201, 240, 0.2);
    color: var(--success-color);
}

.milestone-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.milestone-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.status-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    /* FIX: Ensure buttons are clickable */
    position: relative;
    z-index: 4;
}

.status-btn:hover {
    transform: translateY(-2px);
}

/* Enhanced Gantt Chart */
.enhanced-gantt-container {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    border: 1px solid var(--border-color);
    /* FIX: Ensure proper stacking */
    position: relative;
    z-index: 1;
}

.gantt-chart-enhanced {
    margin-top: 20px;
    position: relative;
    height: 300px;
    overflow-x: auto;
    /* FIX: Allow scrolling without blocking */
    z-index: 1;
}

.gantt-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    /* FIX: Don't block clicks */
    pointer-events: none;
    z-index: 1;
}

.gantt-grid-cell {
    flex: 1;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    position: relative;
}

.gantt-grid-cell:last-child {
    border-right: none;
}

.gantt-grid-label {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    /* FIX: Don't block clicks */
    pointer-events: none;
}

.gantt-bars-container {
    position: relative;
    height: 100%;
    padding-top: 40px;
    /* FIX: Allow interaction with bars */
    z-index: 2;
}

.gantt-bar-enhanced {
    position: absolute;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    animation: bar-slide 0.8s ease-out;
    opacity: 0.9;
    /* FIX: Ensure bars are clickable */
    cursor: pointer;
    z-index: 3;
}

.gantt-bar-enhanced:hover {
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

@keyframes bar-slide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 0.9;
        transform: translateX(0);
    }
}

.gantt-bar-enhanced .bar-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-in-out;
    /* FIX: Don't block bar clicks */
    pointer-events: none;
}

/* ===== Code Generator Enhancements ===== */
.code-actions {
    display: flex;
    gap: 10px;
    /* FIX: Ensure actions are clickable */
    position: relative;
    z-index: 3;
}

.analysis-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    /* FIX: Ensure tabs are clickable */
    position: relative;
    z-index: 2;
}

.analysis-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    /* FIX: Ensure tabs are clickable */
    z-index: 3;
}

.analysis-tab:hover {
    color: var(--text-primary);
}

.analysis-tab.active {
    color: var(--primary-color);
}

.analysis-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    /* FIX: Don't block clicks */
    pointer-events: none;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
    /* FIX: Ensure content is accessible */
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block;
}

.analysis-content {
    min-height: 200px;
    /* FIX: Ensure content is accessible */
    position: relative;
    z-index: 1;
}

.complexity-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.metric-label {
    font-weight: 500;
    color: var(--text-primary);
}

.metric-value {
    font-family: 'Roboto Mono', monospace;
    color: var(--success-color);
    font-weight: 600;
}

/* ===== Skill Learning Mode ===== */
.learning-mode {
    margin-top: 30px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid var(--border-color);
    /* FIX: Ensure proper stacking */
    position: relative;
    z-index: 1;
}

.learning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.week-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    /* FIX: Ensure selector is clickable */
    position: relative;
    z-index: 2;
}

.week-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    /* FIX: Ensure buttons are clickable */
    position: relative;
    z-index: 3;
}

.week-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#currentWeek {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
    text-align: center;
}

.weekly-plan {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.day-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    /* FIX: Ensure cards are clickable */
    position: relative;
    z-index: 2;
}

.day-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.day-title {
    font-weight: 600;
    color: var(--text-primary);
}

.day-progress {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.task-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    transition: var(--transition);
    /* FIX: Ensure checklist items are clickable */
    position: relative;
    z-index: 3;
}

.checklist-item:hover {
    background: rgba(15, 23, 42, 0.7);
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    /* FIX: Ensure checkbox is clickable */
    position: relative;
    z-index: 4;
}

.checkbox-custom.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-custom.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    /* FIX: Don't block checkbox clicks */
    pointer-events: none;
}

.checklist-text {
    flex: 1;
    color: var(--text-secondary);
    transition: var(--transition);
}

.checklist-item.checked .checklist-text {
    color: var(--text-primary);
    text-decoration: line-through;
}

.resource-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.resource-links h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.resource-link {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    margin: 5px;
    transition: var(--transition);
    /* FIX: Ensure links are clickable */
    position: relative;
    z-index: 2;
}

.resource-link:hover {
    background: rgba(67, 97, 238, 0.2);
    transform: translateY(-2px);
}

/* ===== Typing Animation ===== */
.typing-animation {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
    /* FIX: Don't block content */
    pointer-events: none;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

/* ===== Responsive Enhancements ===== */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .status-filters {
        width: 100%;
        justify-content: center;
    }
    
    .milestone-item {
        flex-direction: column;
    }
    
    .milestone-dot {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .learning-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .week-selector {
        width: 100%;
        justify-content: center;
    }
    
    .code-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* ===== Progress Animations ===== */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease;
}

/* ===== Fade In Animation ===== */
.fade-in {
    animation: fadeIn 0.6s ease;
}

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

/* FIX: CRITICAL - Remove problematic global overlay styles */
/* No full-screen overlays, no fixed elements covering content */

/* FIX: Ensure all interactive elements are clickable */
input, select, button, textarea, a {
    position: relative;
    z-index: 10 !important;
}

/* FIX: Ensure containers don't block their children */
.container, .main-content, .content-area, .content-section {
    position: relative;
    z-index: 1;
}

/* FIX: Ensure sidebar and navigation are clickable */
.sidebar, .nav-menu, .nav-btn {
    position: relative;
    z-index: 20 !important;
}

/* FIX: Remove any potential overlay that blocks the API status */
.api-status {
    position: relative;
    z-index: 30 !important;
}