@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
    background: linear-gradient(to right, #1c1c1c, #262626);
    color: #ecf0f1;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    height: 100vh;
    overflow-y: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 2vh;
    position: relative;
    z-index: 1;
    padding: 0 20px;
    min-height: 95vh; /* Prevent overflow */
    height: 100%;
    justify-content: center;
}

.top-nav {
    padding: 20px 0;
}

.top-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.top-nav li {
    padding: 0;
    border: none;
}

.content {
    display: block;
}

header {
    text-align: center;
    padding: 20px 0;
}

header h1 {
    margin-bottom: 10px;
    font-size: 2.8em;
    font-weight: 700;
    color: #f1c40f;
}

header p {
    font-size: 1.2em;
    color: #dddddd;
}

.main-title {
    margin-bottom: 15px;
    font-size: 3.2em;
    font-weight: 700;
    color: #f1c40f;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #f1c40f, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.3em;
    color: #bdc3c7;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

section {
    flex-basis: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;  /* Center section content */
}

section ul {
    list-style: none;
    padding-left: 0;
}

section h2 {
    margin-bottom: 20px;  /* Reduced from 40px */
    font-size: 1.4em;
    font-weight: 700;
    color: #f1c40f;
    text-align: center;  /* Center the heading */
}

section li {
    background: none;
    margin-bottom: 8px;
    padding: 10px 0;
    border-bottom: none;
}

a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 400;
}

a:hover {
    color: #f1c40f;
    text-decoration: underline;
}

.timeline ul {
    position: relative;
    padding-left: 30px;
    margin-left: 120px;
}

.timeline ul::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;  /* Set full height to prevent layout shift */
    width: 2px;
    background: #f1c40f;
    border-radius: 1px;
    transform: scaleY(0);  /* Start scaled down */
    transform-origin: top;  /* Scale from top to bottom */
    animation: lineExpand 2s forwards;
    animation-delay: 0.5s;
}

@keyframes lineExpand {
    to {
        transform: scaleY(1);  /* Scale up to full size */
    }
}

@keyframes fadeInLine {
    to {
        opacity: 1;
    }
}

.timeline-item {
    position: relative;
    margin-bottom: 15px; /* Reduced from 30px */
    opacity: 0;
    animation: fadeInUp 0.5s forwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(2) {
    animation-delay: 1s;
}

.timeline-item:nth-child(3) {
    animation-delay: 1.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px); /* Slight upward movement */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.timeline-content {
    padding: 10px 0;
}

.timeline-content a {
    font-size: 1.1em;
    color: #ecf0f1;
    transition: color 0.3s ease;  /* Add transition for smooth hover effect */
}

.timeline-content a:hover {
    color: #f1c40f;
    text-decoration: underline;
}

.date {
    position: absolute;
    left: -100px;
    top: 50%;
    transform: translateY(-50%);
    color: #f1c40f;
    font-weight: bold;
    width: 40px;  /* Fixed width for the year */
    text-align: right;  /* Right-align the year */
    font-size: 1.1em;
}

/* Remove the other pseudo-elements */
.timeline-item::before,
.timeline-item::after {
    content: none;
}

.timeline-content {
    .content {
        flex-direction: column;
        gap: 30px;
    }

    section {
        flex-basis: 100%;
    }
}

.timeline {
    width: 100%;  /* Take full width of parent */
    max-width: 500px;  /* Limit maximum width */
    margin-top: 20px;
    height: auto;
}

@media (max-width: 600px) {
    .container {
        gap: 40px;
        padding: 0 15px;
    }

    .main-title {
        font-size: 2.5em;
    }

    .subtitle {
        font-size: 1.1em;
    }

    .timeline ul {
        margin-left: 80px;  /* Increased from 60px */
        padding-left: 40px;  /* Increased from 30px */
    }

    .date {
        left: -90px;  /* Increased from -70px */
    }
}

@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
        gap: 4vh;
    }

    .main-title {
        font-size: 4em;
    }

    .subtitle {
        font-size: 1.5em;
        max-width: 800px;
    }

    section {
        max-width: 800px;
    }

    .timeline ul {
        margin-left: 140px;
    }

    .timeline-content a {
        font-size: 1.2em;
    }

    .date {
        font-size: 1.2em;
        left: -120px;
    }

    section h2 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
}

@media (min-width: 1920px) {
    body {
      overflow-y: hidden;
    }

    .container {
        max-width: 1400px;
        gap: 5vh;
        min-height: 90vh;
    }

    .main-title {
        font-size: 4.5em;
    }

    .subtitle {
        font-size: 1.6em;
        max-width: 900px;
    }
}

/* Add this media query for mobile devices */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
    }

    .container {
        height: auto;
        min-height: 100vh;
    }
}
