/* 2025.10.04 - ADDED universal box-sizing for predictable layouts */
html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}

.modal-open {
    overflow: hidden; /* Prevent background scrolling when modal is open */
}

.perinlat {
    color: #007bff;
    font-weight: normal;
    font-size: 0.9em;
}

/* --- Progress Bar Roadmap Styles --- */
.roadmap-container {
    position: relative;
    padding: 20px 0;
    margin: 2rem 0;
}
.progress-bar-track {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}
.progress-bar-fill {
    height: 100%;
    background-color: #007bff;
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease-in-out;
}
.roadmap-steps {
    list-style: none;
    padding: 0 15px; /* MODIFIED: Indents the start/end points to align with the center of the circles */
    margin: 0;
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}
.roadmap-step {
    width: 30px;
    height: 30px;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
}
.roadmap-step span {
    font-size: 0.8rem;
}
.roadmap-step.completed {
    border-color: #007bff;
    background-color: #007bff;
    color: #fff;
}
.roadmap-step.active {
    border-color: #007bff;
    background-color: #fff;
    color: #007bff;
    transform: scale(1.2);
}

/* --- Modal Dialog Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
    /* 2025.10.04 - Removed flex properties which conflicted with absolute positioning */
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
}

.modal-close:hover {
    color: #333;
}

#modal-body {
    width: 100%;
    /* 2025.10.04 - Increased padding to prevent text from overlapping nav buttons */
    padding: 0 3rem;
}

#modal-body h3 {
    margin-top: 0;
    font-size: 16px;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.modal-nav:hover {
    background: #e0e0e0;
}

.modal-nav.prev {
    left: 15px;
}
.modal-nav.next {
    right: 15px;
}
.modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* 2025.10.04 - Mobile optimizations */
@media (max-width: 600px) {

    /* --- ADDED: Fix for roadmap on mobile --- */
    .roadmap-container {
        overflow-x: auto; /* Enables horizontal scrolling */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        /* Optional: Hide the scrollbar for a cleaner look */
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    .roadmap-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    .roadmap-steps {
        /* Set a minimum width to prevent circles from overlapping */
        min-width: 550px;
    }
    /* --- END OF ADDED FIX --- */

    .modal-content {
        /* Reduce the modal's own padding on small screens */
        padding: 1.5rem 0.5rem;
        max-width: 300px;
    }

    .modal-nav {
        /* Make nav buttons smaller and less intrusive */
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    /* Position them closer to the edge */
    .modal-nav.prev {
        left: 8px;
    }
    .modal-nav.next {
        right: 8px;
    }

    #modal-body {
        /* Reduce padding to give the text more room to breathe */
        padding: 0 2.8rem;
    }

    .modal-close {
        /* Adjust position to match new padding */
        top: 8px;
        right: 12px;
    }
}