/* Custom styles to override or add beyond Bootstrap */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll when offcanvas is active */
}

/* Header / Navbar Customization */
.navbar {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

    .navbar-brand img {
        height: 40px;
        margin-right: 10px;
    }

.nav-link {
    color: #555 !important;
    font-weight: 500;
    position: relative;
}

    .nav-link:hover {
        color: #007bff !important;
    }

.nav-item.active .nav-link::after,
.nav-item .nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background-color: #007bff;
}

/* Main Section */
main {
    padding: 40px 0;
    background-color: #f8f9fa;
}

.search-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
}

    .search-section h1 {
        color: #212529;
        margin-bottom: 15px;
        font-size: 2.2em;
        font-weight: 600;
    }

    .search-section .instruction {
        color: #6c757d;
        margin-bottom: 30px;
        font-size: 1.1em;
    }

.search-form {
    max-width: 550px;
    margin: 0 auto;
    text-align: left;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #fdfdfd;
}

.form-group label {
    font-weight: bold;
    color: #495057;
    font-size: 1em;
}

/* Captcha specific styles */
.captcha-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.captcha-image-container {
    flex-shrink: 0;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #f0f0f0;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#captchaImage {
    width: 120px;
    height: 26px;
    border-radius: 3px;
    object-fit: cover;
}

.captcha-reload {
    cursor: pointer;
    color: #007bff;
    font-size: 1.5em;
    transition: color 0.3s ease;
}

    .captcha-reload:hover {
        color: #0056b3;
    }

/* PDF Viewer Container Styles */
#pdfViewerContainer {
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
}

    #pdfViewerContainer h2 {
        color: #007bff;
        margin-bottom: 15px;
        font-size: 2em;
        text-align: center;
        border-bottom: 2px solid #007bff;
        padding-bottom: 10px;
        width: 100%;
    }

#pdfViewer {
    width: 100%;
    height: 700px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
}

.help-section {
    margin-top: 50px;
    font-size: 0.95em;
    color: #777;
    text-align: center;
    border-top: 1px dashed #ced4da;
    padding-top: 30px;
}

.contact-info {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

/* Footer Styles */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
    font-size: 0.9em;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.1em;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 8px;
}

    .footer-col h4::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        height: 2px;
        width: 50px;
        background-color: #007bff;
    }

.footer-col p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #bdc3c7;
}

    .footer-col p i {
        margin-right: 10px;
        color: #007bff;
    }

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-col ul li {
        margin-bottom: 10px;
    }

        .footer-col ul li a {
            color: #ecf0f1;
            text-decoration: none;
            transition: color 0.3s ease;
        }

            .footer-col ul li a:hover {
                color: #007bff;
            }

.social-links a {
    display: inline-block;
    color: #ecf0f1;
    font-size: 1.6em;
    margin-right: 18px;
    transition: color 0.3s ease, transform 0.2s ease;
}

    .social-links a:hover {
        color: #007bff;
        transform: translateY(-3px);
    }

.copyright {
    text-align: center;
    padding-top: 25px;
    margin-top: 30px;
    border-top: 1px solid #34495e;
}

    .copyright p {
        margin: 0;
        color: #bdc3c7;
    }

/* Responsive Design - Custom Offcanvas-like for Navbar */
@media (max-width: 991.98px) { /* Adjust breakpoint if needed, lg by default for navbar-expand-lg */
    .navbar-collapse {
        position: fixed;
        top: 0;
        left: -250px; /* Hidden off-screen to the left */
        width: 250px; /* Width of the offcanvas menu */
        height: 100%;
        background-color: #fff; /* Background of the sliding menu */
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: transform 0.3s ease-in-out; /* Smooth slide effect */
        z-index: 1050; /* Higher than regular content */
        display: block !important; /* Override Bootstrap's collapse display: none */
    }

        .navbar-collapse.show {
            transform: translateX(250px); /* Slide into view */
        }


    /* Overlay for when menu is open */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

        .overlay.show {
            display: block;
        }
}

@media (max-width: 767.98px) { /* Corresponds to Bootstrap's 'md' breakpoint */
    .search-section {
        padding: 30px 20px;
    }

        .search-section h1 {
            font-size: 1.8em;
        }

        .search-section .instruction {
            font-size: 1em;
        }

    .search-form {
        padding: 15px;
    }

    /* Captcha responsive for small screens */
    .captcha-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .captcha-image-container {
        width: 100%;
        padding: 8px;
    }

    #captchaImage {
        width: 100%;
        height: auto;
        max-width: 120px; /* Keep max-width for image */
    }

    .captcha-group input[type="text"] {
        width: 100%;
    }

    .captcha-reload {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    #pdfViewer {
        height: 500px;
    }

    /* Footer responsive */
    .footer-col {
        text-align: center;
    }

        .footer-col h4::after {
            left: 50%;
            transform: translateX(-50%);
        }
}

@media (max-width: 575.98px) { /* Corresponds to Bootstrap's 'sm' breakpoint */
    .search-section {
        padding: 20px 15px;
    }

        .search-section h1 {
            font-size: 1.5em;
        }

        .search-section .instruction {
            font-size: 0.9em;
        }

    .form-group label {
        font-size: 0.9em;
    }

    .form-group input {
        padding: 8px;
        font-size: 0.9em;
    }

    .btn { /* Apply to all Bootstrap buttons */
        font-size: 0.95em;
        padding: 10px 15px;
    }

    #pdfViewer {
        height: 400px;
    }
}

#searchForm button[type="button"] {
    background: #006699;
    border-color: #006699;
}

    #searchForm button[type="button"]:hover {
        background: #006699;
        border-color: #006699;
    }

footer p, footer p a {
    color: #fff !important;
    text-decoration: auto !important
}

footer {
    background-color: #006699 !important;
}

.container-search {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

    .container-search h2 {
        color: #0066cc;
        margin-bottom: 15px;
        text-align: center;
    }

.search-section {
    margin: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
        color: #555;
        text-align:left;
    }

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

    .form-control:focus {
        outline: none;
        border-color: #0066cc;
        box-shadow: 0 0 5px rgba(0, 102, 204, 0.3);
    }

.btn-search,
.btn-back {
    display: inline-block;
    padding: 12px 30px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

    .btn-search:hover,
    .btn-back:hover {
        background-color: #0052a3;
    }

.btn-back {
    background-color: #6c757d;
    margin-top: 15px;
}

    .btn-back:hover {
        background-color: #5a6268;
    }

.error-message {
    display: block;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-top: 15px;
    border-radius: 4px;
}

.results-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

    .results-section h3 {
        color: #0066cc;
        margin-bottom: 15px;
    }

    .results-section h4 {
        color: #555;
        margin: 15px 0 10px 0;
    }

.results-list {
    list-style: none;
    padding: 0;
}

    .results-list li {
        padding: 10px;
        margin-bottom: 10px;
        background-color: white;
        border: 1px solid #ddd;
        border-radius: 4px;
    }

        .results-list li a {
            color: #0066cc;
            text-decoration: none;
            display: flex;
            align-items: center;
        }

            .results-list li a:hover {
                text-decoration: underline;
            }

            .results-list li a:before {
                content: "📄";
                margin-right: 10px;
                font-size: 20px;
            }

.support-info {
    margin-top: 30px;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    text-align: center;
}
    .support-info p{
        margin:0;
    }
    /* Responsive */
    @media (max-width: 768px) {
        .btn-search, .btn-back {
        width: 100%;
        text-align: center;
    }
}

/* Loading Overlay for UpdateProgress */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-overlay p {
    font-size: 1.15rem;
    font-weight: 600;
    color: #0066cc;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
