/* ==========================================================================
   AI CIRCLE V2 - Interactive Assistant Timeline
   CEO Icon System v2 Compliant - The Architect's Blueprint
   ANIMATED VERSION - Auto-play timeline
   ========================================================================== */

/* Layout - równe kolumny */
.ai-timeline-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    position: relative;
}

/* Left Side - Assistants Panel */
.ai-assistants-panel {
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 122, 204, 0.15);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.ai-assistants-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue, #007acc) 0%, var(--accent-gold, #f7931e) 100%);
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.panel-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

/* Assistant Cards List */
.assistants-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.assistant-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    min-height: 56px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.assistant-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gold, #f7931e);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.assistant-item:hover {
    background: rgba(0, 122, 204, 0.08);
    border-color: rgba(0, 122, 204, 0.25);
    transform: translateX(4px);
}

.assistant-item:hover::before {
    transform: scaleY(1);
}

.assistant-item.active {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.12) 0%, rgba(247, 147, 30, 0.08) 100%);
    border-color: rgba(0, 122, 204, 0.35);
}

.assistant-item.active::before {
    transform: scaleY(1);
    background: var(--accent-blue, #007acc);
}

/* Assistant Icon */
.assistant-icon-v2 {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 122, 204, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.assistant-icon-v2 .svg-icon {
    width: 22px;
    height: 22px;
    stroke: var(--accent-gold, #f7931e);
}

.assistant-item:hover .assistant-icon-v2 {
    background: rgba(0, 122, 204, 0.18);
    transform: scale(1.05);
}

.assistant-item.active .assistant-icon-v2 {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.25) 0%, rgba(247, 147, 30, 0.15) 100%);
    box-shadow: 0 0 20px rgba(0, 122, 204, 0.25);
}

/* Pulse animation for active assistant */
.assistant-item.pulse {
    animation: assistantPulse 0.5s ease-out;
}

@keyframes assistantPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(247, 147, 30, 0.3); }
    100% { transform: scale(1); }
}

/* Assistant Details */
.assistant-details {
    flex: 1;
    min-width: 0;
}

.assistant-name-v2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.15rem;
}

.assistant-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Right Side - Timeline Panel */
.ai-timeline-panel {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: calc(50% - 1rem); /* połowa minus połowa gap */
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.95) 0%, rgba(23, 42, 69, 0.92) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 122, 204, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    overflow: hidden;
}

.ai-timeline-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold, #f7931e) 0%, var(--accent-blue, #007acc) 100%);
}

/* Timeline Header */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-blue, #007acc);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.timeline-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

/* Live indicator */
.timeline-live {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.live-text {
    font-size: 0.75rem;
    color: #4ade80;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Timeline Items Container - smooth scroll */
.timeline-list {
    display: block;
    overflow: hidden !important;
    position: relative;
    flex: 1;
    min-height: 0; /* Pozwala flex-child się kurczyć */
}

/* Scroll container for smooth animation */
.timeline-scroll-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}


/* Timeline Item - ZUNIFIKOWANY LAYOUT: [czas] [treść] [badge] [check] */
/* WAŻNE: ID selector nadpisuje timeline.css z nth-child(even) row-reverse */
#timelineList .timeline-item,
#timelineList .timeline-item:nth-child(odd),
#timelineList .timeline-item:nth-child(even),
.timeline-list .timeline-item,
.timeline-list .timeline-item:nth-child(odd),
.timeline-list .timeline-item:nth-child(even) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    margin: 0 0 0.35rem 0 !important; /* NADPISUJE timeline.css margin: 3rem 0 */
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--accent-gold, #f7931e);
    transition: transform 0.5s ease-out, opacity 0.3s ease-out;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Visible state - nie potrzebuje już zmian opacity */
.timeline-item.visible,
#timelineList .timeline-item.visible,
.timeline-list .timeline-item.visible {
    opacity: 1;
}

.timeline-item.highlight,
#timelineList .timeline-item.highlight,
.timeline-list .timeline-item.highlight {
    background: rgba(0, 122, 204, 0.08);
    border-color: rgba(0, 122, 204, 0.25);
    box-shadow: 0 4px 20px rgba(0, 122, 204, 0.15);
}

.timeline-item.exiting,
#timelineList .timeline-item.exiting,
.timeline-list .timeline-item.exiting {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timeline Time */
.timeline-time {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    font-family: var(--font-family-mono, 'SF Mono', Monaco, monospace);
    min-width: 38px;
    flex-shrink: 0;
}

/* Timeline Content */
.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-action {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.3;
    margin-bottom: 0.15rem;
    font-weight: 500;
}

/* Timeline Benefit - THE VALUE */
.timeline-benefit {
    font-size: 0.7rem;
    color: #4ade80;
    line-height: 1.2;
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
}

.timeline-benefit::before {
    content: '→';
    color: var(--accent-gold, #f7931e);
    font-weight: 700;
    flex-shrink: 0;
}

/* Timeline Meta (badge + check) - ZUNIFIKOWANY */
.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Timeline Badge - zunifikowany styl z ramką */
.timeline-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 32px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.timeline-item.highlight .timeline-badge {
    border-color: var(--accent-gold, #f7931e);
    color: var(--accent-gold, #f7931e);
    background: rgba(247, 147, 30, 0.1);
}

/* Timeline Checkmark */
.timeline-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #4ade80;
}

.timeline-check svg {
    width: 14px;
    height: 14px;
    stroke: #4ade80;
}

/* CTA Footer - always at bottom */
.timeline-footer {
    margin-top: 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    flex-shrink: 0;
}

.timeline-cta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.timeline-cta strong {
    color: var(--accent-gold, #f7931e);
}

.timeline-saved {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4ade80;
    margin-top: 0.5rem;
}

/* ==========================================================================
   RESPONSIVE - Mobile First
   ========================================================================== */

@media (max-width: 1024px) {
    .ai-timeline-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .timeline-list {
        max-height: 320px;
    }
}

@media (max-width: 768px) {
    .ai-assistants-panel,
    .ai-timeline-panel {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .panel-title {
        font-size: 1.3rem;
    }

    .assistants-list {
        gap: 0.4rem;
    }

    .assistant-item {
        padding: 0.75rem;
        min-height: 52px;
    }

    .assistant-icon-v2 {
        width: 36px;
        height: 36px;
    }

    .assistant-icon-v2 .svg-icon {
        width: 20px;
        height: 20px;
    }

    .timeline-item {
        /* ZAWSZE w jednej linii - bez wrap */
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .timeline-time {
        font-size: 0.7rem;
        min-width: 32px;
    }

    .timeline-content {
        min-width: 0; /* pozwala na text-overflow */
    }

    .timeline-action {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .timeline-benefit {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .timeline-meta {
        flex-shrink: 0;
    }

    .timeline-badge {
        min-width: 36px;
        height: 32px;
        font-size: 0.6rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .ai-assistants-panel,
    .ai-timeline-panel {
        padding: 1rem;
    }

    .panel-title {
        font-size: 1.2rem;
    }

    .assistant-item {
        gap: 0.75rem;
    }

    .timeline-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .timeline-live {
        align-self: flex-start;
    }
}
