/* Base styles */
body, html {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

body h1 {
    color: #004C80;
}

/* Header section */
.intro-image {
    max-width: 100%;
    border-radius: 10px;
}

.visa-header-text {
    flex: 1;
    margin-right: 20px;
    text-align: left;
}

.visa-header-text h1 {
    margin-bottom: 10px;
    color: #004C80;
}

.visa-header-text p {
    margin-top: 0;
}

.visa-image {
    flex: 1;
    max-width: 600px; /* Limit the max width for better alignment */
    height: auto;
    border-radius: 20px;
}


@media (max-width: 768px) {
    .navbar-collapse {
        overflow-x: hidden; /* Prevent horizontal scrolling in the entire nav */
    }

    .dropdown-menu {
        width: 100vw; /* Full viewport width */
        max-width: 100vw; /* Prevent exceeding viewport width */
        max-height: 80vh; /* Limit height to 80% of the viewport height */
        overflow-x: hidden; /* Strictly prevent horizontal scrolling */
        overflow-y: auto; /* Allow vertical scrolling if necessary */
        box-sizing: border-box; /* Include padding and border in the element's width */
        padding: 0; /* Adjust padding if needed */
    }

    /* Remove any unwanted focus outline around dropdown toggle */
    .dropdown-toggle:focus {
        outline: none;
        box-shadow: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    /* Disable hover styles for dropdown items */
    .dropdown-item:hover,
    .dropdown-toggle:hover {
        background-color: transparent; /* Removes background color change on hover */
        color: inherit; /* Keeps the text color unchanged */
    }

    /* Remove any focus or active state effects that might persist */
    .dropdown-item:focus,
    .dropdown-toggle:focus,
    .dropdown-item:active,
    .dropdown-toggle:active {
        background-color: transparent;
        box-shadow: none;
        outline: none;
    }
}

/* Ensures no extra padding or margin causes horizontal scroll */

/* Content container */
.content-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Article styles */
.article {
    flex: 3;
    padding: 20px;
}
.article-content p {
    text-align: justify;
}

/* Table of contents (TOC) styles */
.toc {
    flex-basis: 300px;
    background: #f0f8ff;
    padding: 10px;
    border-radius: 10px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 80px; /* Accounts for fixed navbar height */
    margin-right: 20px;
}

.toc h2 {
    margin-top: 0;
}

.toc ul {
    list-style: none;
    padding: 20px;
}

.toc li {
    margin-bottom: 10px;
}

.toc a {
    color: #333;
    text-decoration: none;
    display: block;
    font-weight: bold;
}

.toc a:hover {
    text-decoration: underline;
}

.toc span {
    display: block;
    font-size: 0.85em;
    color: #777;
    margin-top: 4px;
    margin-bottom: 10px;
}

/* TOC Section Header Styles */
.toc-section h3 {
    font-size: 1em;
    color: #004C80;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

.toc-section-header {
    font-size: 0.9em;
    color: #FF9900; /* Set color to match the yellow-orange highlight */
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* Small yellow-orange line next to the section title */
.toc-section-header::before {
    content: "";
    display: inline-block;
    width: 30px; /* Adjust width to match desired length */
    height: 3px; /* Adjust thickness */
    background-color: #FF9900;
    margin-right: 8px; /* Spacing between line and text */
    border-radius: 2px; /* Optional: round the edges */
}


.toc a {
    color: #333;
    text-decoration: none;
    display: block;
    font-weight: bold;
    transition: all 0.3s ease; /* Smooth transition for styling */
}

/* Style for the active section in the TOC */
.toc a.active-section {
    /* Styles removed to disable highlighting */
}

@media (max-width: 768px) {
    .content-container {
        display: block; /* Ensure the content stacks vertically */
        padding: 0;
        margin-top: 0px !important;/* Remove any extra padding */
    }

    .toc {
        position: static; /* Remove sticky or relative positioning */
        max-height: none; /* Remove the height constraint */
        margin-bottom: 20px; /* Add space below the TOC */
        width: 100%; /* Make TOC full-width on mobile */
        overflow-y: visible; /* Ensure TOC doesn't scroll independently */
    }

    .article {
        width: 100%; /* Ensure the article takes full width */
        /* margin-top: 20px; /* Add some space above the article */ */
    }
    .intro-header h1 {
        text-align: center;
    }

    .visa-container {
        width: 100%;
        max-width: 800px; /* Adjust the width as needed */
        margin: 20px auto; /* Centers the table on the page */
        padding: 0px !important; /* Removes any padding */;
    }
    .article {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}

section h1, section h2 {
    margin-top: 0;
}

/* Media queries for mobile */


/* Visa Table Styles */
    /* Container for the table */
    .visa-container {
        width: 100%;
        max-width: 800px; /* Adjust the width as needed */
        margin: 20px auto; /* Centers the table on the page */
        padding: 20px;
    }

    /* Main table styling */
    .visa-table {
        width: 100%;
        border-collapse: collapse; /* Removes default spacing between table cells */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Adds subtle shadow */
    }

    .visa-table th,
    .visa-table td {
        padding: 15px;
        text-align: left;
        font-size: 16px;
        color: #1d3e6e; /* Matches the dark blue text color */
    }

    /* Header cell styling */
    .visa-table th {
        font-weight: bold;
        background-color: #fff; /* Background color for header cells */
        width: 250px; /* Fixed width for header cells */
    }

    /* Data cell styling */
    .visa-table td {
        background-color: #f7f9fb; /* Background color for data cells */
    }

    /* Row and cell border styling */
    .visa-table tr {
        border-bottom: 1px solid #ddd; /* Light gray border between rows */
    }

    .visa-table tr:last-child {
        border-bottom: none; /* Removes the border from the last row */
    }

    .visa-table th,
    .visa-table td {
        border-right: 1px solid #ddd; /* Light gray vertical border */
    }

    .visa-table th:last-child,
    .visa-table td:last-child {
        border-right: none; /* Removes vertical border from the last column */
    }

    /* Responsive styling for mobile */
    @media screen and (max-width: 768px) {
        .visa-table {
            width: 100%; /* Full width on mobile */
        }

        .visa-table th {
            width: 35%; /* Set a percentage width for headers on mobile */
            min-width: 150px; /* Minimum width to avoid text wrapping */
            padding: 10px; /* Compact padding */
        }

        .visa-table td {
            width: 65%; /* Set remaining space for data cells */
            padding: 10px; /* Compact padding */
        }

        .visa-table th,
        .visa-table td {
            font-size: 14px; /* Adjust font size for smaller screens */
        }
    }


/* Dropdown menu customization */
/* Dropdown menu customization */
/* Hide the dropdown menu by default */


/* Content container */
.content-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Article styles */
.article {
    flex: 1;
    order: 2; /* On desktop, article appears second */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Intro header */
.intro-header {
    width: 100%;
    margin-bottom: 20px;
}

.section {
    scroll-margin-top: 60px; /* Adjust this value based on your navbar height */
}