/* ===================================================================
   TRACKING.CSS - Live Tracking Demo Section
   =================================================================== */

.tracking-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 50%, var(--bg-darker) 100%);
    position: relative;
    overflow: hidden;
}

.tracking-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.tracking-demo {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 50px;
}

/* Tracking Window */
.tracking-window {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(99, 102, 241, 0.1);
}

.tracking-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
}

.tracking-dots {
    display: flex;
    gap: 8px;
}

.tracking-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.tracking-dots .dot.red { background: #ff5f57; }
.tracking-dots .dot.yellow { background: #ffbd2e; }
.tracking-dots .dot.green { background: #28ca41; }

.tracking-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

.tracking-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.live-pulse {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Deadline Banner */
.tracking-deadline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    flex-wrap: wrap;
}

.deadline-icon {
    font-size: 18px;
}

.tracking-deadline strong {
    color: var(--primary-light);
    font-weight: 700;
}

.deadline-note {
    color: var(--text-muted);
    font-size: 12px;
}

/* Timeline */
.tracking-timeline {
    padding: 24px 20px;
}

/* Timeline Branch */
.timeline-branch {
    position: relative;
    margin-bottom: 8px;
}

.timeline-branch:last-child {
    margin-bottom: 0;
}

.timeline-branch::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 44px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-branch:last-child::before {
    display: none;
}

.timeline-branch.completed::before {
    background: var(--success);
}

.timeline-branch.in-progress::before {
    background: linear-gradient(180deg, var(--primary) 0%, var(--border-color) 100%);
}

/* Branch Header */
.branch-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-darker);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.branch-header:hover {
    background: var(--bg-card-hover);
}

.branch-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.branch-icon.completed {
    background: var(--success);
    color: white;
}

.branch-icon.in-progress {
    background: var(--primary);
    color: white;
}

.branch-icon.pending {
    background: var(--bg-card-hover);
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
}

.progress-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.branch-info {
    flex: 1;
}

.branch-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.branch-time {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.branch-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.branch-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.branch-status.in-progress {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.branch-status.pending {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

/* Branch Items (expandable) */
.branch-items {
    padding: 12px 0 12px 56px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-branch.pending .branch-items {
    display: none;
}

/* Timeline Item */
.timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.timeline-item:hover {
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.timeline-item:hover .item-dot {
    transform: scale(1.5);
    box-shadow: 0 0 12px var(--primary);
}

.item-time {
    width: 50px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Monaco', 'Consolas', monospace;
}

.item-dot {
    width: 10px;
    height: 10px;
    background: var(--text-muted);
    border-radius: 50%;
    flex-shrink: 0;
    transition: var(--transition);
}

.timeline-branch.completed .item-dot {
    background: var(--success);
}

.timeline-branch.in-progress .item-dot {
    background: var(--primary);
}

.item-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    animation: activePulse 2s infinite;
}

.item-dot.commit {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

@keyframes activePulse {
    0%, 100% { box-shadow: 0 0 10px var(--primary); }
    50% { box-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary); }
}

.item-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

.timeline-item.highlight .item-text {
    color: var(--primary-light);
    font-weight: 600;
}

.timeline-item.active .item-text {
    color: var(--text-primary);
}

/* Commit Badge - enhanced visibility */
.commit-badge {
    font-size: 11px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(251, 191, 36, 0.3) 100%);
    color: #fbbf24;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    animation: commitGlow 2s ease-in-out infinite;
}

@keyframes commitGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), 0 0 30px rgba(245, 158, 11, 0.2); }
}

/* Has-commit row styling */
.timeline-item.has-commit {
    background: rgba(245, 158, 11, 0.05);
    border-left: 3px solid var(--warning);
    margin-left: -3px;
}

.timeline-item.has-commit:hover {
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}

.timeline-item.has-commit:hover .item-dot.commit {
    transform: scale(1.8);
    box-shadow: 0 0 15px var(--warning);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Tooltip on Hover */
.timeline-item::after {
    content: attr(data-tooltip-de);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-darker);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 350px;
    white-space: normal;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    pointer-events: none;
}

.timeline-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Touch - Active Tooltip State */
.timeline-item.tooltip-active::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.timeline-item.tooltip-active {
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.timeline-item.has-commit.tooltip-active {
    background: rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

/* English Tooltips */
html[lang="en"] .timeline-item::after {
    content: attr(data-tooltip-en);
}

/* Vietnamese Tooltips */
html[lang="vi"] .timeline-item::after {
    content: attr(data-tooltip-vi);
}

/* Tracking Features Grid */
.tracking-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 50px;
}

.tracking-feature {
    text-align: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.tracking-feature:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.feature-icon-wrapper {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}

.tracking-feature h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tracking-feature p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}
