/**
 * Timeline Order Game Styles
 * Arrange the jobs in chronological order!
 */

.timeline-game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.timeline-game-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.timeline-game-container {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 24px;
    padding: 2rem;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid var(--accent-primary, #c084fc);
    box-shadow: 
        0 0 60px rgba(192, 132, 252, 0.3),
        0 25px 50px rgba(0, 0, 0, 0.5);
}

.timeline-game-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-game-close:hover {
    background: rgba(244, 114, 182, 0.3);
    transform: rotate(90deg);
}

.timeline-game-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.timeline-game-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.timeline-game-title .title-emoji {
    -webkit-text-fill-color: initial;
    background: none;
    font-size: 1.5rem;
}

.timeline-game-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.timeline-game-instructions {
    background: rgba(192, 132, 252, 0.1);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.timeline-game-instructions p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
}

.timeline-game-instructions .instruction-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Stats */
.timeline-game-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.timeline-game-stat {
    text-align: center;
}

.timeline-game-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #c084fc;
    font-family: 'JetBrains Mono', monospace;
}

.timeline-game-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Job Blocks Container */
.timeline-blocks-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    min-height: auto;
}

/* Individual Job Block */
.timeline-job-block {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.timeline-job-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #c084fc, #f472b6);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.timeline-job-block:hover {
    border-color: rgba(192, 132, 252, 0.5);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(192, 132, 252, 0.2);
}

.timeline-job-block:hover::before {
    opacity: 1;
}

.timeline-job-block:active {
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(192, 132, 252, 0.3);
    z-index: 100;
}

.timeline-job-block.dragging {
    opacity: 0.8;
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 15px 40px rgba(192, 132, 252, 0.4);
    z-index: 1000;
}

.timeline-job-block.drag-over {
    border-color: #f472b6;
    background: rgba(244, 114, 182, 0.1);
}

.timeline-job-block.correct {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    animation: correctPulse 0.5s ease;
}

.timeline-job-block.correct::before {
    background: #4ade80;
    opacity: 1;
}

.timeline-job-block.wrong {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    animation: wrongShake 0.5s ease;
}

.timeline-job-block.wrong::before {
    background: #f87171;
    opacity: 1;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.job-block-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.job-block-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.job-block-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.job-block-company {
    font-size: 0.75rem;
    color: #f472b6;
    margin: 0;
}

.job-block-period {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    display: none; /* Hidden during gameplay */
}

.timeline-job-block.reveal .job-block-period {
    display: block;
}

.job-block-drag-handle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 1rem;
}

/* Arrow indicators */
.timeline-arrow {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.2rem;
    padding: 0.25rem;
}

/* Check Button */
.timeline-game-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.timeline-check-btn,
.timeline-reset-btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.timeline-check-btn {
    background: linear-gradient(135deg, #c084fc, #f472b6);
    color: white;
    box-shadow: 0 4px 15px rgba(192, 132, 252, 0.3);
}

.timeline-check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

.timeline-check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.timeline-reset-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.timeline-reset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Result Message */
.timeline-result {
    text-align: center;
    padding: 1.5rem;
    margin-top: 1rem;
    border-radius: 12px;
    display: none;
}

.timeline-result.show {
    display: block;
    animation: slideUp 0.3s ease;
}

.timeline-result.success {
    background: rgba(74, 222, 128, 0.15);
    border: 2px solid rgba(74, 222, 128, 0.3);
}

.timeline-result.error {
    background: rgba(248, 113, 113, 0.15);
    border: 2px solid rgba(248, 113, 113, 0.3);
}

.timeline-result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-result.success .timeline-result-title {
    color: #4ade80;
}

.timeline-result.error .timeline-result-title {
    color: #f87171;
}

.timeline-result-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

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

/* Play button trigger */
.timeline-trigger {
    text-align: center;
    margin-top: 2rem;
}

.play-timeline-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.2), rgba(244, 114, 182, 0.2));
    border: 2px solid rgba(192, 132, 252, 0.4);
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-timeline-btn:hover {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.3), rgba(244, 114, 182, 0.3));
    border-color: rgba(192, 132, 252, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(192, 132, 252, 0.3);
}

.play-timeline-btn .game-icon {
    font-size: 1.3rem;
    animation: iconBounce 2s infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Confetti container */
.timeline-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .timeline-game-container {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .timeline-game-title {
        font-size: 1.4rem;
    }
    
    .timeline-job-block {
        padding: 0.5rem 0.75rem;
    }
    
    .job-block-title {
        font-size: 0.8rem;
    }
    
    .job-block-company {
        font-size: 0.7rem;
    }
    
    .job-block-icon {
        font-size: 1rem;
    }
    
    .timeline-game-stats {
        gap: 1.5rem;
    }
    
    .timeline-game-stat-value {
        font-size: 1.4rem;
    }
}
