/* --- Official Government Theme --- */
:root {
    --primary-font: 'Poppins', sans-serif;
    --bg-color: #f4f7fa; /* Light Gray Background */
    --primary-color: #ffffff; /* White for containers */
    --secondary-color: #e9ecef; /* Lighter gray for accents */
    --primary-blue: #0056b3; /* Official Blue */
    --text-color: #212529; /* Dark text for readability */
    --header-color: #003d82;
    --border-color: #ced4da;
    --success-color: #198754;
    --error-color: #dc3545;
    --form-bg-color: #ffffff;
    --form-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--primary-font);
    background-color: var(--bg-color);
    background-image: linear-gradient(to top, #e9ecef 0%, #f4f7fa 100%);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

.main-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    transition: padding-left 0.3s ease;
}

body.sidebar-open .main-content-area {
    padding-left: calc(20px + 220px);
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--primary-color);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 20px;
    background-color: #2683e0;
    border-bottom: 2px solid #dee2e6;
}

.header-logo {
    height: 70px;
    width: auto;
}

.header-text {
    text-align: center;
}

.main-header h1 {
    font-family: var(--primary-font);
    font-size: 2.2rem;
    font-weight: 600;
    color:white;
    margin-bottom: 5px;
}

.main-header p {
    font-size: 1rem;
    color:white;
}

.main-content {
    padding: 30px 40px;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 800px; /* Adjust as needed */
    margin: 0 auto;
    padding: 20px;
    background-color: var(--form-bg-color);
    border-radius: 8px;
    box-shadow: var(--form-shadow);
}

.form-container h2 {
    font-family: var(--primary-font);
    font-size: 1.8rem;
    color: var(--header-color);
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-color);
    font-family: var(--primary-font);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    resize: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.btn {
    padding: 12px 05px;
    font-family: var(--primary-font);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff;
    background-color: var(--primary-blue);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn:hover:not(:disabled) {
    background-color: var(--header-color);
}

.btn:disabled {
    background-color: #a0b8d1;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}
.btn-secondary:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.form-link {
    text-align: center;
    margin-top: 15px;
}

.form-link a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.form-link a:hover {
    text-decoration: underline;
}

.main-footer {
    text-align: center;
    padding: 15px;
    background-color: var(--secondary-color);
    border-top: 1px solid #dee2e6;
    font-size: 0.9rem;
    color: #6c757d;
}

.error-message {
    color: red;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 15px;
}

.success-message {
    color: var(--success-color);
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 15px;
}

/* Dashboard and other specific styles */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.dashboard-header h2 { text-align: left; }
.logout-btn { font-size: 0.9rem; font-weight: 600; color: var(--primary-blue); text-decoration: none; border: 1px solid var(--primary-blue); padding: 8px 15px; border-radius: 5px; transition: all 0.3s ease; }
.logout-btn:hover { background-color: var(--primary-blue); color: #fff; }
#apps_table, #dependents_table, #dependents_preview_table { width: 100%; border-collapse: collapse; margin-top: 20px; }
#apps_table th, #apps_table td, #dependents_table th, #dependents_table td, #dependents_preview_table th, #dependents_preview_table td { padding: 12px; border: 1px solid var(--border-color); text-align: left; }
#apps_table thead, #dependents_table thead, #dependents_preview_table thead { background-color: #e9ecef; }
.preview-container { background-color: #f8f9fa; padding: 30px; border-radius: 10px; border: 1px solid #dee2e6; }
.preview-section h3 { color: var(--header-color); font-size: 1.5rem; border-bottom: 1px solid #dee2e6; padding-bottom: 10px; margin-bottom: 15px; }
.preview-item { display: grid; grid-template-columns: 220px 1fr; gap: 10px; margin-bottom: 8px; }
.preview-item strong { color: #495057; }
.preview-item span { color: var(--text-color); }
.form-step-header h2 {
    font-family: var(--display-font);
    font-size: 2.2rem;
    color: var(--accent-color);
}
.form-step-indicator { font-size: 1rem; color: var(--text-color); }
.form-navigation { display: flex; justify-content: space-between; margin-top: 30px; }
input[readonly] { background-color: #e9ecef; }
textarea[readonly] { background-color: #e9ecef; }
#dependents_table input { width: 100%; background-color: #fff; border: 1px solid var(--border-color); padding: 8px; color: var(--text-color); }
.remove-row-btn { background: var(--error-color); color: white; border: none; padding: 5px 10px; cursor: pointer; border-radius: 4px; }
.add-row-btn { margin-top: 15px; background: var(--success-color); color: #fff; border: none; padding: 10px 15px; cursor: pointer; border-radius: 4px; font-weight: bold; }

/* Sidebar Styles */
.sidebar {
    width: 200px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #dee2e6;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar h2 {
    font-size: 1.5rem;
    color: var(--header-color);
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 600;
    display: block;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.sidebar ul li a:hover {
    background-color: #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 0;
    }
    .main-header {
        flex-direction: column;
        padding: 15px;
    }
    .header-logo {
        height: 60px;
        margin-bottom: 10px;
    }
    .main-header h1 {
        font-size: 1.5rem;
    }
    .main-header p {
        font-size: 0.9rem;
    }
    .main-content {
        padding: 20px;
    }
    .btn {
        font-size: 1rem;
    }
    .sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        position: relative;
    }
    body {
        flex-direction: column;
    }
}

/* Sidebar CSS from sidebar.php */
/* ===== Menu Button ===== */
.menu-btn {
    position: fixed;
    left: 20px;
    top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all .5s ease-in-out;
    z-index: 2000; /* Always on top */
    background-color: #001f3f;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.menu-btn__burger {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 5px;
    transition: all .5s ease-in-out;
    position: relative;
}
.menu-btn__burger::before,
.menu-btn__burger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 5px;
    transition: all .5s ease-in-out;
}
.menu-btn__burger::before {
    transform: translateY(-8px);
}
.menu-btn__burger::after {
    transform: translateY(8px);
}

/* Animate Menu Button */
.menu-btn.open .menu-btn__burger {
    transform: translateX(-30px);
    background: transparent;
}
.menu-btn.open .menu-btn__burger::before {
    transform: rotate(45deg) translate(21px, -21px);
}
.menu-btn.open .menu-btn__burger::after {
    transform: rotate(-45deg) translate(21px, 21px);
}

/* ===== Sidebar ===== */
.sidebar {
    width: 220px;
    background: #001f3f;
    border-right: 3px solid #00bfff;
    z-index: 1500;
    padding-top: 80px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: none; /* Hidden by default */
}

.sidebar.show-sidebar {
    display: block; /* Visible when toggled */
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin: 0;
    position: relative;
}

.sidebar ul li a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    display: block;
    padding: 20px 25px;
    transition: 0.3s;
    border-left: 5px solid transparent;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #00bfff;
    color: #001f3f;
    border-left: 5px solid white;
    box-shadow: 0 0 15px #00bfff;
}

/* Dropdown styles */
.dropdown-content {
    display: none;
    background-color: #002a54;
    padding-left: 20px;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content li a {
    padding: 15px 25px;
    font-size: 16px;
    border-left: none;
}

.dropdown-content li a:hover {
    background-color: #00bfff;
    color: #001f3f;
    box-shadow: none;
}

/* Styles for conditional sections */
.conditional-section {
    display: none;
    padding-left: 20px;
    border-left: 3px solid var(--primary-blue);
    margin-top: 20px;
    padding-top: 10px;
}
.form-group-inline .form-group {
    flex: 1;
}

/* Styles for form_step4.php */
#dependents_table { width: 100%; border-collapse: collapse; margin-top: 20px; }
#dependents_table th, #dependents_table td { padding: 12px; border: 1px solid var(--border-color); text-align: center; }
#dependents_table th { background-color: var(--secondary-color); }
#dependents_table input { width: 100%; background-color: #fff; border: 1px solid var(--border-color); padding: 8px; color: var(--text-color); }
.remove-row-btn { background: var(--error-color); color: white; border: none; padding: 5px 10px; cursor: pointer; border-radius: 4px; }
.add-row-btn { margin-top: 15px; background: var(--success-color); color: #fff; border: none; padding: 10px 15px; cursor: pointer; border-radius: 4px; font-weight: bold; }

/* Styles for form_step5.php */
.recurring-details {
    display: none;
    padding-left: 20px;
    border-left: 3px solid var(--primary-blue);
    margin-top: 15px;
}

/* Styles for form_step6.php */
.upload-section {
    border: 2px dashed #ccc;
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    background-color: #f9f9f9;
}
.upload-section h4 {
    color: #0056b3;
    margin-bottom: 15px;
}
.upload-section p {
    margin-bottom: 20px;
}
.upload-placeholder {
    font-style: italic;
    color: #666;
}

.download-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.download-table th,
.download-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.download-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.download-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.download-table tr:hover {
    background-color: #f1f1f1;
}

.download-table .btn {
    width: auto; /* Override default btn width */
    padding: 10px 1px;
    font-size: 0.9em;
}

.download-table .btn:hover {
    background-color: #0056b3;
    border-color: #0056b3; /* Added */
    transform: translateY(-1px); /* Subtle lift */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Subtle shadow */
}
.custom-file-upload-cell {
    max-width: 0;
}
.custom-file-upload-cell .btn {
    font-size: 0.8rem;
    padding: 4px 8px;
}
.custom-file-upload-cell .file-name-display {
    font-size: 0.8rem;
    display: block;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Password Toggle Styles */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 40px; /* Make space for the button */
}

.password-input-container .toggle-password {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #555;
    padding: 5px;
}

.password-input-container .toggle-password:hover {
    color: #000;
}

/* Styles for dep_form_step5.php */
.form-container { position: relative; }
.preview-container { position: relative; background-color: #f9f9f9; padding: 30px; border-radius: 10px; }
.preview-section { margin-bottom: 30px; position: relative; }
.preview-section h3 { color: #0056b3; font-size: 1.8rem; border-bottom: 1px solid #ccc; padding-bottom: 10px; margin-bottom: 15px; }
.preview-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.preview-table th, .preview-table td { padding: 10px; border: 1px solid #ccc; text-align: left; }
.preview-table th { background-color: #f2f2f2; }
.details-container {
    display: flex;
    gap: 20px;
}
.details-table-container {
    flex-grow: 1;
}
.applicant-photo-preview {
    flex-shrink: 0;
}
.applicant-photo-preview img {
        max-width: 120px;
    border: 2px solid #000000;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
.declaration-group {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--secondary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
}
.declaration-group input[type="checkbox"] {
    transform: scale(1.5);
    margin-right: 15px;
    flex-shrink: 0;
}
.declaration-group label {
    font-weight: normal;
    color: var(--text-color);
    line-height: 1.5;
}

/* Styles from form3_step1.php */
.radio-group label {
    display: inline-block;
    margin-right: 15px;
}
button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}
button:hover {
    background-color: #0056b3;
}

/* Styles from form3_step2.php */
.dependent-entry {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* Styles for form3_preview.php */
.preview-section { margin-bottom: 30px; position: relative; border-bottom: 1px solid #eee; padding-bottom: 15px;}
.preview-section:last-child { border-bottom: none; }
.preview-section h2 { color: #0056b3; font-size: 1.8rem; border-bottom: 1px solid #ccc; padding-bottom: 10px; margin-bottom: 15px; }
.preview-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.preview-table th, .preview-table td { padding: 10px; border: 1px solid #ccc; text-align: left; }
.preview-table th { background-color: #f2f2f2; width: 40%; }
.applicant-photo-preview { float: right; margin-left: 20px; margin-top: 50px; }
.applicant-photo-preview img {max-width: 150px; border: 3px solid #000; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.document-preview img, .document-preview embed { max-width: 100%; height: auto; display: block; margin-top: 10px; border: 1px solid #ddd; }
.checkbox-group { display: flex; align-items: flex-start; margin-bottom: 20px; }
.checkbox-group input[type="checkbox"] { margin-right: 15px; flex-shrink: 0; }
.table-with-photo { width: calc(100% - 160px); }