/* ===================================
   TIMELINE PAGE STYLES
   ==================================== */

/* Assuming these variables are defined in your main styles.css file. 
   If not, define them here. Example:
   :root {
       --bg-primary: #1a1a2e;
       --bg-secondary: #16213e;
       --bg-tertiary: #0f3460;
       --text-primary: #e94560;
       --text-secondary: #c0c0c0;
       --accent-primary: #16a085;
       --accent-secondary: rgba(22, 160, 133, 0.3);
       --border-color: #2a3b5c;
       --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
       --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
       --spacing-xs: 8px;
       --spacing-sm: 12px;
       --spacing-md: 16px;
       --spacing-lg: 24px;
       --spacing-xl: 32px;
       --spacing-2xl: 48px;
       --transition-fast: 0.2s ease;
       --transition-medium: 0.4s ease;
   }
*/

.timeline-header {
    background-color: var(--bg-secondary);
    padding: var(--spacing-2xl) 0;
    text-align: center;
    transition: background-color var(--transition-medium);
}

.timeline-intro {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.timeline-section {
    padding: var(--spacing-2xl) 0;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) 0;
}

/* Timeline vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

.timeline-item {
   /* Initial state: hidden and slightly moved down */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    
    /* Keep your other timeline-item styles like 'position', 'margin-bottom', etc. */
    position: relative;
    margin-bottom: var(--spacing-2xl);
    display: flex;
    align-items: flex-start;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-marker {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background-color: var(--accent-primary);
    border: 4px solid var(--bg-primary);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 4px var(--accent-secondary);
    transition: all var(--transition-fast);
}

.timeline-item:hover .timeline-marker {
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 0 8px var(--accent-secondary);
}

.timeline-content {
    width: calc(50% - 40px);
    background-color: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.timeline-date {
    display: inline-block;
    background-color: var(--accent-primary);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.timeline-content h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.timeline-content h4 {
    color: var(--text-muted, #a0a0a0); /* fallback color */
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.timeline-item.education .timeline-marker {
    background-color: var(--success, #48bb78); /* fallback color */
    box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.3);
}

.timeline-item.education .timeline-date {
    background-color: var(--success, #48bb78); /* fallback color */
}

/* Final state: visible and in its original position */
.timeline-item.in-view {
    opacity: 1;
    transform: translateY(0);

/* --- ACCORDION STYLES (NEW) --- */
.expand-btn {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
    margin-top: var(--spacing-sm);
}

.expand-btn:hover {
    background-color: var(--accent-primary);
    color: white;
}

.timeline-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    margin-top: 0;
}

.timeline-details.active {
    max-height: 1000px; /* Large value to allow for expansion */
    margin-top: var(--spacing-md);
}

.timeline-details ul {
    list-style: none;
    padding: 0;
    margin: var(--spacing-md) 0;
}

.timeline-details li {
    color: var(--text-secondary);
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.timeline-details li::before {
    content: '•'; /* Use a bullet point for achievements */
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.6;
}

.skills-used {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.skill-tag {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===================================
   RESPONSIVE DESIGN - TABLET
   ==================================== */

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
        transform: translateX(0);
    }
    
    .timeline-marker {
        left: 20px;
        transform: translateX(-50%);
    }
    
    .timeline-item:hover .timeline-marker {
        transform: translateX(-50%) scale(1.3);
    }
    
    .timeline-item,
    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        flex-direction: row;
        padding-left: 40px; /* Space for the timeline line */
    }
    
    .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        width: 100%;
        margin-left: 20px;
    }
    
    .skills-used,
    .timeline-item:nth-child(odd) .skills-used {
        justify-content: flex-start;
    }
    
    .timeline-details li,
    .timeline-item:nth-child(even) .timeline-details li {
        padding-left: 1.5rem;
        padding-right: 0;
    }
    
    .timeline-details li::before,
    .timeline-item:nth-child(even) .timeline-details li::before {
        left: 0;
        right: auto;
    }
}

/* ===================================
   RESPONSIVE DESIGN - MOBILE
   ==================================== */

@media (max-width: 480px) {
    .timeline-item {
        padding-left: 30px;
    }

    .timeline-content {
        margin-left: 15px;
        padding: var(--spacing-md);
    }
    
    .timeline-content h3 {
        font-size: 1.2rem;
    }
    
    .timeline-date {
        font-size: 0.8rem;
        padding: 0.2rem 0.8rem;
    }
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.05;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation-delay: 7s;
}

.shape-3 {
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

