body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: url('res/sea-background.jpg') repeat-y center center;
    background-size: contain;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.timeline {
    position: relative;
    width: 80%;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: #004d99;
    z-index: -1;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px;
    box-sizing: border-box;
}

.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
}

.timeline-item .content {
    background: rgba(255, 255, 255, 0.8);
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.3s;
}

.timeline-item .content:hover {
    transform: scale(1.05);
}

.timeline-item .date {
    font-weight: bold;
    color: #004d99;
}

.timeline-item .title {
    font-weight: bold;
    color: #003366;
    margin: 10px 0;
}

.timeline-item img,
.timeline-item video {
    width: 100%;
    border-radius: 10px;
}

.timeline-item .text {
    margin-top: 10px;
    color: #003366;
}

.floating-buttons {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000; /* Ensure buttons are above all other elements */
}

#music-player {
    background: #004d99;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#music-player.active {
    background-color: #007f00; /* Slightly greener shade */
}

#music-player i {
    font-size: 24px;
}

#play-pause {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

#play-pause i {
    font-size: 24px;
}

#auto-scroll-button {
    background: #004d99;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#auto-scroll-button i {
    font-size: 24px;
}

#scroll-speed-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 80px; /* Positioned under the auto-scroll button */
    left: 20px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

#scroll-speed-controls button {
    background: #004d99;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px; /* Reduced size by 30% */
    height: 16px; /* Reduced size by 30% */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px; /* Reduced font size */
    margin: 2px; /* Adjusted spacing */
}

#scroll-speed-controls.hidden {
    display: none;
}

#auto-scroll-button.active + #scroll-speed-controls {
    opacity: 1;
}

#auto-scroll-button.active {
    background-color: #007f00; /* Slightly greener shade */
}

 .timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-item div
{
  font-family: "Varela Round", Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
}

.timeline-item.left .timeline-mark {
    position: absolute;
    /*right: 10px;*/
    top: 30%;
    /*top: -10px; /* Adjust this value to fine-tune vertical alignment */
    transform: translate(10%, 0%); /* Center the mark both horizontally and vertically */
    width: 30px;
    height: 30px;
    z-index: 1;
    object-fit: contain;
    pointer-events: none;
}

.timeline-item.right .timeline-mark {
    position: absolute;
    /*right: 10px;*/
    top: 30%;
    /*top: -10px; /* Adjust this value to fine-tune vertical alignment */
    transform: translate(-110%, 0%); /* Center the mark both horizontally and vertically */
    width: 30px;
    height: 30px;
    z-index: 1;
    object-fit: contain;
    pointer-events: none;
}

.timeline-item .timeline-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure the image scales down properly */
} 

/* Responsive Design */
@media (max-width: 768px) {
    .timeline {
        width: 90%;
    }

    .timeline::before {
        left: 20px;
        transform: none;
    }

    .timeline-item {
        width: 100%;
        padding-left: 40px;
        padding-right: 20px;
    }

    .timeline-item.left,
    .timeline-item.right {
        left: 0;
        text-align: left;
    }

    .timeline-item.left .timeline-mark {
        position: absolute;
        /*right: 10px;*/
        top: 30%;
        /*top: -10px; /* Adjust this value to fine-tune vertical alignment */
        transform: translate(-110%, 0%); /* Center the mark both horizontally and vertically */
        width: 30px;
        height: 30px;
        z-index: 1;
        object-fit: contain;
        pointer-events: none;
    }

    .opening-message {
        padding: 10px; /* Add some padding to avoid edges touching the screen */
    }

    .opening-content {
        width: 100%; /* Make the content take up full width */
        max-width: 100%; /* Ensure the content doesn't exceed the screen width */
        padding: 20px; /* Adjust padding to keep content within view */
    }

    .opening-content h1 {
        font-size: 1.8em; /* Reduce font size for better fit */
    }

    .opening-content p {
        font-size: 1em; /* Reduce font size for better readability */
    }

    .opening-content button {
        font-size: 1em;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .timeline {
        width: 95%;
    }

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

    .timeline-item img,
    .timeline-item video {
        border-radius: 5px;
    }

    .timeline-item .date {
        font-size: 14px;
    }

    .timeline-item .text {
        font-size: 14px;
    }

    .opening-message {
        padding: 5px; /* Further reduce padding for smaller screens */
    }

    .opening-content {
        padding: 15px; /* Reduce padding for smaller screens */
    }

    .opening-content h1 {
        font-size: 1.6em; /* Further reduce font size */
    }

    .opening-content p {
        font-size: 0.9em; /* Further reduce font size */
    }

    .opening-content button {
        font-size: 0.9em;
        padding: 6px 12px;
    }
}

/* Add RTL support for moments description */
.rtl {
    direction: rtl;
    text-align: right;
}

/* Opening Message Styles */
.opening-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.opening-message.hidden {
    display: none;
}

.opening-message h1
{
    font-family: 'Heebo', Arial, sans-serif;
}

.opening-message div
{
  font-family: "Varela Round", Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
}

.opening-message button
{
  font-family: "Varela Round", Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
}

.opening-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-width: 600px; /* Maximum width for larger screens */
    height: 75%; /* Fixed height for consistency */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.opening-content h1 {
    font-size: 2.5em;
    color: #003366;
    margin-bottom: 20px;
}

.opening-content p {
    font-size: 1.2em;
    color: #004d99;
    margin-bottom: 30px;
}

.opening-content button {
    padding: 10px 20px;
    font-size: 1.2em;
    color: white;
    background: #004d99;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.opening-content button:hover {
    background: #003366;
}

.hidden {
    display: none;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.page {
    height: 100%; /* Ensure each page takes the full height */
    overflow-y: auto; /* Add scroll for overflow content */
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Center the single button when only one is visible */
#prev-button.hidden + #next-button {
    margin-left: auto; /* Push the 'Next' button to the right */
    flex: none; /* Reset flex behavior to allow margin to work */
}

/* Responsive Design for Opening Message */
@media (max-width: 480px) {
    .opening-content h1 {
        font-size: 2em;
    }

    .opening-content p {
        font-size: 1em;
    }

    .opening-content button {
        font-size: 1em;
        padding: 8px 16px;
    }
}
