/* Milestones Timeline Styles */
.milestones-timeline-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.milestones-timeline-container .header {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 40px;
    text-align: center;
    position: relative;
    border-bottom: 2px solid #e0e0e0;
}

.milestones-timeline-container .header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.milestones-timeline-container .header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    color: #2c3e50;
    font-weight: 700;
}

.milestones-timeline-container .timeline {
    padding: 40px;
    position: relative;
}

.milestones-timeline-container .timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #3498db, #9b59b6);
    transform: translateX(-50%);
    border-radius: 2px;
}

.milestones-timeline-container .timeline-item {
    margin-bottom: 40px;
    position: relative;
    display: flex;
    align-items: center;
    opacity: 0;
    animation: slideIn 0.6s ease-out forwards;
    min-height: 80px; /* Ensure minimum height for marker positioning */
}

.milestones-timeline-container .timeline-item:nth-child(odd) {
    flex-direction: row;
    animation-delay: calc(var(--index) * 0.1s);
}

.milestones-timeline-container .timeline-item:nth-child(even) {
    flex-direction: row-reverse;
    animation-delay: calc(var(--index) * 0.1s);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.milestones-timeline-container .timeline-content {
    flex: 1;
    max-width: calc(50% - 40px);
    background: #ffffff;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    border-left: 4px solid #3498db;
    border: 1px solid #e0e0e0;
}

.milestones-timeline-container .timeline-item:nth-child(even) .timeline-content {
    border-left: none;
    border-right: 4px solid #9b59b6;
}

.milestones-timeline-container .timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.milestones-timeline-container .timeline-date {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.milestones-timeline-container .timeline-sober {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.milestones-timeline-container .timeline-item:nth-child(even) .timeline-date {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.milestones-timeline-container .timeline-item:nth-child(even) .timeline-sober {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.milestones-timeline-container .timeline-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

.milestones-timeline-container .timeline-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* Base Timeline Marker - Desktop */
.milestones-timeline-container .timeline-marker {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    border-radius: 50%;
    position: absolute;
    left: calc(50% - 10px); /* Center on timeline line */
    top: 20px;
    z-index: 2;
    border: 4px solid white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(52, 152, 219, 0.1);
    }
}

.milestones-timeline-container .stats {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}

.milestones-timeline-container .stat-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.milestones-timeline-container .stat-item:hover {
    transform: translateY(-3px);
}

.milestones-timeline-container .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    display: block;
}

.milestones-timeline-container .stat-label {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.milestones-timeline-container .award-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px rgba(243, 156, 18, 0.5); }
    to { box-shadow: 0 0 15px rgba(243, 156, 18, 0.8); }
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .milestones-timeline-container .timeline-content {
        max-width: calc(50% - 30px);
        padding: 20px;
    }

    .milestones-timeline-container .header h1 {
        font-size: 2.2rem;
    }

    .milestones-timeline-container .timeline {
        padding: 30px 20px;
    }

    .milestones-timeline-container .stats {
        padding: 25px 20px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }

    /* Tablet Timeline Marker Fix */
    .milestones-timeline-container .timeline-marker {
        width: 18px;
        height: 18px;
        left: calc(50% - 9px); /* Center on timeline line */
        top: 20px;
        transform: none;
        position: absolute;
    }
}

/* Mobile and Small Tablet Responsive */
@media (max-width: 768px) {
    .milestones-timeline-container .header h1 {
        font-size: 1.8rem;
        padding: 0 10px;
    }

    .milestones-timeline-container .header {
        padding: 25px 15px;
    }

    .milestones-timeline-container .timeline {
        padding: 20px 15px;
        position: relative;
    }

    .milestones-timeline-container .timeline::before {
        left: 25px;
        width: 3px;
    }

    .milestones-timeline-container .timeline-item {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 55px;
        margin-bottom: 30px;
        position: relative;
    }

    .milestones-timeline-container .timeline-content {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 20px;
        border-left: 4px solid #3498db !important;
        border-right: none !important;
        position: relative;
    }

    /* Mobile Timeline Marker Fix */
    .milestones-timeline-container .timeline-marker {
        left: calc(25px - 8px); /* 25px is timeline line position, -8px centers 16px circle */
        width: 16px;
        height: 16px;
        top: 20px;
        transform: none; /* Remove transform to avoid positioning conflicts */
        position: absolute;
        border-width: 3px; /* Slightly thinner border for mobile */
    }

    .milestones-timeline-container .timeline-date {
        font-size: 0.8rem;
        padding: 6px 12px;
        margin-bottom: 10px;
        display: block;
        width: fit-content;
    }

    .milestones-timeline-container .timeline-sober {
        margin-left: 0;
        margin-top: 8px;
        font-size: 0.8rem;
        padding: 6px 12px;
        display: block;
        width: fit-content;
    }

    .milestones-timeline-container .timeline-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
        line-height: 1.4;
    }

    .milestones-timeline-container .timeline-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .milestones-timeline-container .award-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
        margin-left: 8px;
        margin-top: 5px;
        display: inline-block;
    }

    .milestones-timeline-container .stats {
        padding: 20px 15px;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .milestones-timeline-container .stat-item {
        padding: 15px;
    }

    .milestones-timeline-container .stat-number {
        font-size: 1.5rem;
    }

    .milestones-timeline-container .stat-label {
        font-size: 0.8rem;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .milestones-timeline-container .header h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .milestones-timeline-container .timeline {
        padding: 15px 10px;
        position: relative;
    }

    .milestones-timeline-container .timeline::before {
        left: 20px;
    }

    .milestones-timeline-container .timeline-item {
        padding-left: 45px;
        margin-bottom: 25px;
        position: relative;
    }

    .milestones-timeline-container .timeline-content {
        padding: 15px;
        border-radius: 8px;
        position: relative;
    }

    /* Extra Small Mobile Timeline Marker Fix */
    .milestones-timeline-container .timeline-marker {
        left: calc(20px - 7px); /* 20px is timeline line position, -7px centers 14px circle */
        width: 14px;
        height: 14px;
        top: 20px;
        transform: none;
        position: absolute;
        border-width: 2px; /* Thinner border for small screens */
    }

    .milestones-timeline-container .timeline-date,
    .milestones-timeline-container .timeline-sober {
        font-size: 0.75rem;
        padding: 5px 10px;
        margin-bottom: 8px;
    }

    .milestones-timeline-container .timeline-title {
        font-size: 1rem;
    }

    .milestones-timeline-container .timeline-description {
        font-size: 0.85rem;
    }

    .milestones-timeline-container .stats {
        padding: 15px 10px;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .milestones-timeline-container .stat-item {
        padding: 12px;
    }

    .milestones-timeline-container .stat-number {
        font-size: 1.3rem;
    }

    .milestones-timeline-container .award-badge {
        display: block;
        margin-left: 0;
        margin-top: 8px;
        width: fit-content;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .milestones-timeline-container .header {
        padding: 20px 15px;
    }

    .milestones-timeline-container .header h1 {
        font-size: 1.6rem;
    }

    .milestones-timeline-container .timeline {
        padding: 15px;
    }
}

/* Fix for very wide tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .milestones-timeline-container .timeline-content {
        max-width: calc(50% - 35px);
    }
    
    .milestones-timeline-container .timeline-date,
    .milestones-timeline-container .timeline-sober {
        font-size: 0.85rem;
        padding: 7px 14px;
    }
}