/* journey-complete.css - Complete Interactive Timeline Styles with Mobile Support */

/* Journey Wrapper */
.journey-wrapper {
    position: relative;
    padding: 2rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.journey-wrapper.active {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Bar */
.journey-progress {
    margin-bottom: 3rem;
}

.journey-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.journey-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 3px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.journey-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Timeline Track */
.journey-timeline {
    margin-bottom: 3rem;
    position: relative;
    padding: 2rem 0;
}

.journey-timeline-track {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 2rem;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) rgba(59, 130, 246, 0.1);
}

.journey-timeline-track::-webkit-scrollbar {
    height: 6px;
}

.journey-timeline-track::-webkit-scrollbar-track {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 3px;
}

.journey-timeline-track::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
}

/* Timeline Node */
.timeline-node {
    flex: 0 0 auto;
    width: 200px;
    position: relative;
    cursor: pointer;
    transition: all 0.4s ease;
    opacity: 0.6;
}

.timeline-node.active {
    opacity: 1;
    transform: scale(1.05);
}

.timeline-node.past {
    opacity: 0.8;
}

.timeline-node.future {
    opacity: 0.4;
}

.timeline-node.hover {
    transform: translateY(-5px);
    opacity: 1 !important;
}

/* Node Connector */
.node-connector {
    position: absolute;
    top: 40px;
    left: 100%;
    width: 2rem;
    height: 2px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), transparent);
    z-index: 0;
}

.timeline-node:last-child .node-connector {
    display: none;
}

/* Node Circle */
.node-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    transition: all 0.4s ease;
}

.timeline-node.active .node-circle {
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
    transform: scale(1.1);
}

.node-icon {
    font-size: 2rem;
    filter: grayscale(0);
}

/* Node Pulse Animation */
.timeline-node.active .node-pulse {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(1.4);
        opacity: 0;
    }
}

/* Node Content */
.node-content {
    text-align: center;
}

.node-year {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.node-title {
    font-size: 0.875rem;
    color: var(--light-text);
    line-height: 1.4;
}

.timeline-node.active .node-title {
    color: var(--text-color);
    font-weight: 500;
}

/* Company name inside timeline node */
.node-company {
    font-size: 0.813rem;
    color: var(--light-text);
    opacity: 0.9;
    margin-top: 0.125rem;
}

/* Info Card */
.journey-info-card {
    background: var(--bg-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 3rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid;
    border-color: rgba(59, 130, 246, 0.1);
}

.info-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.info-meta {
    flex: 1;
}

.info-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.info-company {
    color: var(--light-text);
    font-size: 1rem;
}

.info-body {
    margin-bottom: 1.5rem;
}

.info-description {
    color: var(--light-text);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.info-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-chip {
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.tech-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.info-footer {
    display: flex;
    justify-content: flex-end;
}

.explore-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.explore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.explore-btn i {
    transition: transform 0.3s ease;
}

.explore-btn:hover i {
    transform: translateX(4px);
}

/* Controls */
.journey-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.3);
    background: var(--bg-color);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.125rem;
}

.control-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

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

.control-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Journey Indicators */
.journey-indicators {
    display: flex;
    gap: 0.5rem;
    margin-left: 2rem;
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-dot:hover {
    background: rgba(59, 130, 246, 0.4);
    transform: scale(1.2);
}

.indicator-dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
}

.indicator-dot.past {
    background: rgba(59, 130, 246, 0.5);
}

/* Modal Enhancements */
.journey-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.journey-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.journey-modal .modal-content {
    background: var(--bg-color);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.journey-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--light-text);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    transform: rotate(90deg);
}

.modal-journey-header {
    padding: 2rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-radius: 16px 16px 0 0;
}

.modal-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.modal-info {
    flex: 1;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-meta {
    font-size: 1.125rem;
    opacity: 0.9;
}

.modal-section {
    padding: 2rem;
}

.modal-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.modal-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.modal-tech-item {
    padding: 1rem;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.modal-tech-item:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
}

/* Dark Mode Mobile Adjustments */
body.dark .journey-info-card {
    background: var(--dark-section-bg);
    border-color: rgba(96, 165, 250, 0.2);
}

body.dark .control-btn {
    background: var(--dark-section-bg);
    border-color: rgba(96, 165, 250, 0.3);
}

body.dark .journey-progress-track {
    background: rgba(96, 165, 250, 0.1);
}

body.dark .tech-chip {
    background: rgba(96, 165, 250, 0.1);
}

body.dark .modal-tech-item {
    border-color: rgba(96, 165, 250, 0.2);
}

/* Dark mode timeline nodes */
@media (max-width: 1024px) {
    body.dark .timeline-node {
        background: rgba(96, 165, 250, 0.05);
    }

    body.dark .timeline-node.active {
        background: rgba(96, 165, 250, 0.15);
        border-color: rgba(96, 165, 250, 0.5);
    }

    body.dark .journey-controls {
        background: var(--dark-section-bg);
        border-color: rgba(96, 165, 250, 0.3);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    body.dark .control-btn {
        background: var(--dark-section-bg);
        border-color: rgba(96, 165, 250, 0.3);
        color: #60a5fa;
    }

    body.dark .control-btn:hover:not(:disabled) {
        background: #60a5fa;
        border-color: #60a5fa;
        color: var(--dark-section-bg);
    }

    /* Simpler animations on mobile */
    @keyframes shimmer {
        0% { opacity: 0.5; }
        50% { opacity: 1; }
        100% { opacity: 0.5; }
    }

    .journey-progress-bar::after {
        animation: none;
        display: none;
    }
}

/* Additional grid layout improvements */
@media (max-width: 1024px) {
    /* Ensure equal height cards in grid */
    .journey-timeline-track {
        align-items: stretch;
    }

    .timeline-node {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .node-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1;
    }

    /* Improve active state visibility in grid */
    .timeline-node.active::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        border-radius: 13px;
        background: linear-gradient(45deg, var(--primary-color), #6366f1);
        z-index: -1;
        opacity: 0.3;
    }

    /* Past nodes styling */
    .timeline-node.past {
        opacity: 0.9;
    }

    .timeline-node.past .node-circle {
        background: linear-gradient(135deg, #10b981, #059669);
    }

    /* Future nodes styling */
    .timeline-node.future {
        opacity: 0.5;
    }

    .timeline-node.future .node-circle {
        background: linear-gradient(135deg, #9ca3af, #6b7280);
    }
}

/* =================================
   MOBILE STYLES
   ================================= */

@media (max-width: 768px) {
    /* Journey Wrapper */
    .journey-wrapper {
        padding: 1rem 0;
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 80px);
    }

    /* Progress Bar */
    .journey-progress {
        margin-bottom: 0.75rem;
    }

    .journey-progress-track {
        height: 4px;
    }

    /* Timeline - Compact horizontal row on mobile */
    .journey-timeline {
        margin-bottom: 1rem;
        padding: 0.5rem 0;
    }

    .journey-timeline-track {
        display: flex;
        gap: 0.75rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem 0.75rem;
        height: 160px;
    }

    /* Timeline Node - Chip/card style on mobile */
    .timeline-node {
        width: 140px;
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        opacity: 0.7;
        position: relative;
        padding: 0.5rem;
        background: rgba(59, 130, 246, 0.05);
        border-radius: 12px;
        border: 1px solid transparent;
        transition: all 0.3s ease;
        min-height: 100px;
    }

    .timeline-node.active {
        opacity: 1;
        background: rgba(59, 130, 246, 0.1);
        border-color: var(--primary-color);
        transform: none;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    }

    .timeline-node.hover {
        transform: none;
        background: rgba(59, 130, 246, 0.08);
    }

    /* Hide connector lines in grid layout */
    .node-connector {
        display: none;
    }

    /* Node Circle - Centered for grid layout */
    .node-circle {
        width: 46px;
        height: 46px;
        margin: 0 auto 0.5rem;
        flex-shrink: 0;
    }

    .timeline-node.active .node-circle {
        transform: scale(1.1);
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    }

    .node-icon {
        font-size: 1.5rem;
    }

    /* Node Content - Vertical layout for cards */
    .node-content {
        flex: 1;
        text-align: center;
        width: 100%;
        min-width: 0; /* allow text to shrink and clamp properly */
    }

    .node-year {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
        color: var(--primary-color);
        font-weight: 600;
    }

    .node-title {
        font-size: 0.813rem;
        font-weight: 500;
        line-height: 1.2;
        word-break: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        max-width: 100%;
    }

    /* Company name inside node - mobile specific clamp */
    .node-company {
        font-size: 0.75rem;
        margin-top: 0.125rem;
        color: var(--light-text);
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
    }

    /* Hide pulse animation on mobile */
    .node-pulse {
        display: none;
    }

    /* Info Card - Compact mobile design, fills remaining height */
    .journey-info-card {
        padding: 1.25rem;
        border-radius: 12px;
        flex: 1 1 auto;
        min-height: 0; /* Allow flex container to shrink */
        overflow-y: auto; /* Scroll inside the card if needed */
        margin-bottom: 5rem; /* Space for fixed controls */
    }

    .info-header {
        flex-direction: row;
        gap: 0.75rem;
        align-items: flex-start;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .info-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .info-title {
        font-size: 1rem;
        line-height: 1.2;
        margin-bottom: 0.125rem;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .info-company {
        font-size: 0.75rem;
        opacity: 0.8;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .info-body {
        margin-bottom: 0;
    }

    .info-description {
        font-size: 0.813rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    .info-technologies {
        gap: 0.25rem;
    }

    .tech-chip {
        padding: 0.125rem 0.5rem;
        font-size: 0.688rem;
    }
    
    /* Additional tech indicator */
    .info-more-tech {
        font-size: 0.75rem;
        color: var(--light-text);
        margin-top: 0.5rem;
        font-style: italic;
    }

    /* Hide footer and explore button on mobile */
    .info-footer {
        display: none;
    }

    /* Controls - Fixed position on mobile */
    .journey-controls {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg-color);
        padding: 0.75rem;
        border-radius: 30px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        z-index: 100;
        gap: 0.75rem;
        border: 1px solid rgba(59, 130, 246, 0.2);
    }

    /* Prevent header text/icon overlap */
    .info-header .info-meta {
        flex: 1 1 auto;
        min-width: 0;
    }
    .info-header .info-title,
    .info-header .info-company {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-width: 1px;
    }

    /* Indicators */
    .journey-indicators {
        display: flex;
        gap: 0.375rem;
        margin-left: 1rem;
        max-width: 120px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .journey-indicators::-webkit-scrollbar {
        display: none;
    }

    .indicator-dot {
        width: 8px;
        height: 8px;
        flex-shrink: 0;
    }

    /* Modal - Hidden on mobile */
    .journey-modal {
        display: none !important;
    }

    /* Dark mode mobile adjustments */
    body.dark .timeline-node {
        background: rgba(96, 165, 250, 0.05);
    }

    body.dark .timeline-node.active {
        background: rgba(96, 165, 250, 0.15);
        border-color: rgba(96, 165, 250, 0.5);
    }

    body.dark .journey-controls {
        background: var(--dark-section-bg);
        border-color: rgba(96, 165, 250, 0.3);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    /* Simpler animations on mobile */
    @keyframes shimmer {
        0% { opacity: 0.5; }
        50% { opacity: 1; }
        100% { opacity: 0.5; }
    }

    .journey-progress-bar::after {
        animation: none;
        display: none;
    }
}

/* Even smaller screens - Single column */
@media (max-width: 480px) {
    .journey-timeline-track {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .timeline-node {
        padding: 0.875rem;
        min-height: 100px;
    }

    .node-circle {
        width: 45px;
        height: 45px;
        margin-bottom: 0.5rem;
    }

    .node-icon {
        font-size: 1.25rem;
    }

    .node-year {
        font-size: 0.688rem;
    }

    .node-title {
        font-size: 0.75rem;
    }

    .journey-info-card {
        padding: 1rem;
    }

    .journey-controls {
        padding: 0.625rem;
        gap: 0.5rem;
        bottom: 15px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}

/* Small tablets in portrait - 2 columns */
@media (min-width: 481px) and (max-width: 768px) {
    .journey-timeline-track {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape orientation on mobile - 3 columns */
@media (max-width: 768px) and (orientation: landscape) {
    .journey-timeline-track {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .timeline-node {
        padding: 0.75rem;
        min-height: 90px;
    }

    .node-circle {
        width: 40px;
        height: 40px;
        margin-bottom: 0.5rem;
    }

    .node-icon {
        font-size: 1.25rem;
    }

    .node-year {
        font-size: 0.688rem;
    }

    .node-title {
        font-size: 0.75rem;
    }

    /* Adjust info card for landscape */
    .journey-info-card {
        padding: 1rem;
        margin-bottom: 5rem;
    }

    .info-header {
        gap: 0.5rem;
    }

    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .info-title {
        font-size: 0.875rem;
    }

    .info-description {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    /* Smaller controls in landscape */
    .journey-controls {
        padding: 0.5rem;
        gap: 0.5rem;
        bottom: 10px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .journey-indicators {
        margin-left: 0.75rem;
    }

    .indicator-dot {
        width: 6px;
        height: 6px;
    }
}

/* Tablets in portrait - 3 columns */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .journey-timeline-track {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
        overflow: visible;
        padding: 1.5rem;
    }

    .timeline-node {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
        background: rgba(59, 130, 246, 0.05);
        border-radius: 12px;
        min-height: 140px;
    }

    .node-connector {
        display: none;
    }

    .node-circle {
        width: 60px;
        height: 60px;
        margin: 0 auto 1rem;
    }

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