/* General Reset and Font */
:root {
    --primary-bg: #f4f7fa;
    --sidebar-bg: #ffffff;
    --header-bg: #ffffff;
    --text-color: #334155;
    --text-muted: #64748b;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb; /* Hover color for buttons */
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Noto Sans Bengali', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Main Admin Panel Layout --- */
.admin-panel-container { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background-color: var(--sidebar-bg); border-right: 1px solid var(--border-color); transition: transform 0.3s ease-in-out; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 1rem; font-size: 1.5rem; font-weight: 600; text-align: center; border-bottom: 1px solid var(--border-color); }
.sidebar-nav { padding-top: 1rem; }
.sidebar-nav ul { list-style: none; padding: 0; }
.sidebar-nav > ul > li { margin: 0 0 4px 0; }
.sidebar-nav li a { display: flex; align-items: center; padding: 0.9rem 1.5rem; text-decoration: none; color: var(--text-muted); font-weight: 500; transition: all 0.2s ease; border-left: 3px solid transparent; position: relative; }
.sidebar-nav li a i:first-child { font-size: 1.1rem; margin-right: 1rem; width: 20px; text-align: center; }
.sidebar-nav li.active > a, .sidebar-nav li > a:hover { background-color: #eef2ff; color: var(--accent-color); border-left-color: var(--accent-color); }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Critical fix for mobile responsiveness with wide content */
}

header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background-color: var(--header-bg); border-bottom: 1px solid var(--border-color); }
.header-left { display: flex; align-items: center; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; margin-right: 1rem; color: var(--text-color); }
header h2 { font-size: 1.5rem; font-weight: 600; }

/* Modified User Info for Dropdown */
.header-right .user-info {
    display: flex;
    align-items: center;
    position: relative; /* Keep relative positioning */
    cursor: pointer;
    /* Add padding to keep the hover state active when moving to the dropdown */
    padding-bottom: 10px; /* Adjust as needed */
    margin-bottom: -10px; /* Counteract the padding to maintain layout */
}
.user-info img { width: 40px; height: 40px; border-radius: 50%; margin-right: 0.75rem; }
.user-name { font-weight: 500; }

/* Modified Dropdown Content for Hover Fix */
.dropdown-content {
    display: none;
    position: absolute;
    /* top: 100%; Removed to use the calc value below */
    right: 0;
    background-color: #fff;
    min-width: 160px;
    box-shadow: var(--shadow);
    z-index: 1001; /* Increase z-index if needed */
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px; /* Add margin to separate from the user info visually */
}
.user-info:hover .dropdown-content {
    display: block;
    /* Ensure the dropdown appears correctly */
    top: calc(100% - 10px); /* Adjust based on the padding added above */
}
.dropdown-content a { color: var(--text-color); padding: 12px 16px; text-decoration: none; display: flex; align-items: center; transition: background-color 0.2s; }
.dropdown-content a:hover { background-color: #f1f1f1; }
.dropdown-content i { margin-right: 10px; color: var(--text-muted); }


/* --- Submenu Styles --- */
.submenu-arrow { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); font-size: 0.8rem; transition: transform 0.3s ease; }
.has-submenu.open > a > .submenu-arrow { transform: translateY(-50%) rotate(180deg); }
.submenu { list-style: none; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; background-color: #f8fafc; }
.has-submenu.open > .submenu { max-height: 500px; }
.submenu li a { padding-left: 3.8rem; font-size: 0.9rem; }
.submenu li a:hover { border-left-color: #a5b4fc; }

/* --- Dashboard Page Styles --- */
main { padding: 1.5rem; }
.info-bar { display: flex; justify-content: space-between; align-items: center; background-color: #fff; padding: 0.75rem 1.5rem; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: 1.5rem; flex-wrap: wrap; }
.info-bar-datetime { font-weight: 500; color: var(--text-muted); }
.slider-container { position: relative; width: 100%; height: 280px; overflow: hidden; border-radius: 12px; margin-bottom: 1.5rem; }
.slider-wrapper { position: relative; width: 100%; height: 100%; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease-in-out; z-index: 1; }
.slide.active { opacity: 1; z-index: 2; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-indicators { position: absolute; bottom: 15px; right: 20px; display: flex; gap: 6px; z-index: 3; }
.indicator-dot { width: 8px; height: 8px; background-color: rgba(255, 255, 255, 0.5); border-radius: 4px; cursor: pointer; transition: width 0.4s ease, background-color 0.4s ease; }
.indicator-dot.active { width: 24px; background-color: rgba(255, 255, 255, 0.9); }
.cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.card { background-color: #fff; border-radius: 8px; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.card a { text-decoration: none; color: inherit; display: block; padding: 1.5rem 1rem; text-align: center; }
.card-icon { font-size: 2.2rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1rem; font-weight: 600; }

/* --- Alert Page Styles --- */
.main-centered { display: flex; justify-content: center; align-items: center; flex-grow: 1; }
.alert-container { background-color: #ffffff; border-radius: 12px; box-shadow: var(--shadow); padding: 3rem 2.5rem; max-width: 550px; width: 100%; text-align: center; border-top: 5px solid var(--accent-color); opacity: 0; animation: fadeIn 0.5s 0.2s forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.alert-icon { font-size: 3.5rem; color: var(--accent-color); margin-bottom: 1.5rem; }
.alert-heading { font-size: 1.5rem; font-weight: 600; color: var(--text-color); margin-bottom: 1rem; }
.alert-text { color: var(--text-muted); line-height: 1.7; margin-bottom: 2rem; font-size: 1rem; }
.action-button { display: inline-block; background-color: var(--accent-color); color: #ffffff; font-size: 1rem; font-weight: 500; text-decoration: none; padding: 0.8rem 2.5rem; border-radius: 8px; transition: background-color 0.3s ease, transform 0.2s ease; }
.action-button:hover { background-color: var(--accent-hover); transform: translateY(-2px); }
.action-button i { margin-right: 8px; }

/* --- Nagorik Info Panel Page Styles --- */
.page-content-wrapper { padding: 1.5rem; }
.main-wrapper { background-color: #ffffff; border-radius: 12px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); padding: 2rem; width: 100%; box-sizing: border-box; border: 1px solid #e9ecef; }
.header-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-bottom: 18px; border-bottom: 1px solid #dee2e6; flex-wrap: wrap; gap: 1rem; }
.back-link { text-decoration: none; color: #007bff; font-size: 14.5px; font-weight: 500; transition: color 0.2s ease; display: flex; align-items: center; }
.back-link i { margin-right: 8px; font-size: 16px; }
.back-link:hover { color: #0056b3; }
.resource-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.resource-buttons .btn { background-color: #ffffff; color: #007bff; padding: 9px 16px; border-radius: 20px; text-decoration: none; font-size: 13.5px; display: flex; align-items: center; transition: all 0.3s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #007bff; }
.resource-buttons .btn:hover { background-color: #007bff; color: white; border-color: #007bff; }
.resource-buttons .btn i { margin-right: 7px; }
.content-area { display: flex; flex-direction: column; gap: 30px; margin-top: 25px; }
.section-title { color: #34495e; font-size: 22px; font-weight: 600; margin-bottom: 25px; text-align: left; position: relative; padding-bottom: 10px; border-bottom: 2px solid #007bff; display: inline-block; }
.conditions-list ul { list-style: none; padding: 0; margin: 0; text-align: left; }
.conditions-list li { margin-bottom: 10px; font-size: 15px; color: #333; display: flex; align-items: flex-start; line-height: 1.6; }
.conditions-list li span:first-child { font-size: 17px; line-height: 1; margin-right: 9px; flex-shrink: 0; }
.conditions-list li span:last-child { font-weight: 500; }
.checkmark { color: #28a745; }
.warning-icon { color: #dc3545; }
.timeline { position: relative; margin: 0; padding: 0; }
.timeline-item { position: relative; margin-bottom: var(--timeline-item-margin-bottom, 20px); padding-left: 60px; min-height: 60px; display: flex; align-items: center; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 20px; top: 20px; bottom: calc(-1 * var(--timeline-item-margin-bottom, 20px) - 20px); width: 2px; background-color: #ced4da; z-index: 0; }
.timeline-item:last-child::before { display: none; }
.timeline-icon { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; background-color: #007bff; color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 18px; font-weight: 700; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); z-index: 1; border: 3px solid #ffffff; }
.timeline-content { background-color: #e9f5ff; padding: 18px 25px; border-radius: 10px; font-size: 15px; color: #333; line-height: 1.6; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); border: 1px solid #cce5ff; transition: transform 0.2s ease, box-shadow 0.2s ease; flex-grow: 1; }
.timeline-content:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12); }
.timeline-content strong { color: #0056b3; }
.call-to-action-section { text-align: center; margin-top: 30px; }
.apply-button { background-color: #007bff; color: white; padding: 10px 24px; font-size: 15px; cursor: pointer; border-radius: 6px; border: none; transition: all 0.3s ease; box-shadow: 0 3px 10px rgba(0, 123, 255, 0.2); font-weight: 600; letter-spacing: 0.2px; text-decoration: none; display: inline-block; }
.apply-button:hover { background-color: #0056b3; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0, 123, 255, 0.3); }
.application-status-section { margin-top: 25px; text-align: center; }
.application-status-section .section-title { display: block; text-align: center; margin-bottom: 20px; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 auto; border-radius: 10px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); }
.status-table { width: 100%; border-collapse: collapse; margin: 0; min-width: 600px; }
.status-table th, .status-table td { border: 1px solid #e0e0e0; padding: 12px 15px; text-align: left; font-size: 15px; color: #333; }
.status-table th { background-color: #007bff; color: white; font-weight: 600; text-transform: uppercase; font-size: 14px; letter-spacing: 0.5px; }
.status-table tr:nth-child(even) { background-color: #f8f9fa; }
.status-table tr:hover { background-color: #e9f5ff; }
.status-table td.status-pending { color: #ffc107; font-weight: 500; }
.status-table td.status-approved { color: #28a745; font-weight: 500; }
.status-table td.status-rejected { color: #dc3545; font-weight: 500; }
.status-action-btn { background-color: #007bff; color: white; border: none; padding: 6px 12px; border-radius: 5px; font-size: 14px; cursor: pointer; transition: background-color 0.3s ease; display: inline-flex; align-items: center; gap: 5px; }
.status-action-btn:hover { background-color: #0056b3; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal-content { background-color: #fefefe; margin: auto; padding: 30px; border-radius: 10px; width: 90%; max-width: 600px; box-shadow: 0 8px 30px rgba(0,0,0,0.2); position: relative; animation: modalFadeIn 0.3s; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.close-button { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-button:hover, .close-button:focus { color: black; }
.modal-title { font-size: 24px; font-weight: 600; color: #34495e; margin-bottom: 25px; border-bottom: 2px solid #007bff; padding-bottom: 10px; text-align: center; }
.modal-timeline { position: relative; padding-left: 0; }
.modal-timeline::before { content: ''; position: absolute; left: 19px; top: 0; bottom: 0; width: 2px; background-color: #ced4da; }
.modal-timeline-item { margin-bottom: 25px; position: relative; padding-left: 45px; }
.modal-timeline-item:last-child { margin-bottom: 0; }
.modal-timeline-item::before { content: ''; position: absolute; left: 10px; top: 0; width: 18px; height: 18px; background-color: #007bff; border-radius: 50%; border: 3px solid #fefefe; box-shadow: 0 0 0 2px #007bff; }
.modal-timeline-item.active::before { background-color: #28a745; box-shadow: 0 0 0 2px #28a745; }
.modal-timeline-item.rejected::before { background-color: #dc3545; box-shadow: 0 0 0 2px #dc3545; }
.modal-timeline-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 5px; }
.modal-timeline-details { font-size: 14px; color: #555; line-height: 1.5; }
.modal-timeline-details span { display: block; margin-bottom: 3px; }
.modal-timeline-details .person-name { font-style: italic; color: #777; }

/* --- Responsive Rules --- */
@media (min-width: 992px) { .content-area { flex-direction: row; } .conditions-list, .steps-section { flex: 1; } }
@media (max-width: 991px) { .main-wrapper { padding: 1.5rem; } .header-section { flex-direction: column; align-items: flex-start; } }
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; top: 0; height: 100%; transform: translateX(-260px); z-index: 1000; }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 15px rgba(0,0,0,0.2); }
    .menu-toggle { display: block; }
    header { padding: 1rem; }
    main { padding: 1rem; }
    .info-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .slider-container { height: 200px; }
    .cards-container {
        /* grid-template-columns: repeat(3, 1fr); Previous rule, commented out */
        grid-template-columns: repeat(3, 1fr); /* Set to 3 columns for mobile */
        gap: 0.75rem;
    }
    .card a { padding: 1rem 0.5rem; }
    .card-icon { font-size: 2rem; }
    .card h3 { font-size: 0.8rem; }
    .page-content-wrapper { padding: 1rem 0.5rem; }
    .main-wrapper { padding: 1rem; }
    .section-title { font-size: 18px; }
    .timeline-item { padding-left: 50px; }
    .timeline-icon { width: 35px; height: 35px; font-size: 16px; }
    .timeline-item::before { left: 17.5px; }
}
@media (max-width: 420px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr); /* Ensure it remains 3 columns for very small screens too */
    }
}

/* ========================================================== */
/* FINAL FIX: Citizen Reg Page Font & Animation Override    */
/* ========================================================== */
#nagorikRegistrationApp,
#nagorikRegistrationApp .form-group input[type="text"],
#nagorikRegistrationApp .form-group input[type="date"],
#nagorikRegistrationApp .form-group select,
#nagorikRegistrationApp .radio-option-container label,
#nagorikRegistrationApp .file-upload-wrapper p,
#nagorikRegistrationApp .button-group button,
#nagorikRegistrationApp .info-message,
#nagorikRegistrationApp .attachment-note,
#nagorikRegistrationApp .timeline-content,
#nagorikRegistrationApp .conditions-list li {
    font-size: 15px !important;
}

#nagorikRegistrationApp .form-group label {
    font-size: 14px !important;
    font-weight: 500 !important;
}

#nagorikRegistrationApp h2 {
    font-size: 24px !important;
}

#nagorikRegistrationApp .step-navigation .step-item {
    font-size: 16px !important;
}

#nagorikRegistrationApp .card-header {
    font-size: 18px !important;
}

#nagorikRegistrationApp .card:hover {
    transform: none !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05) !important;
}

/* --- Mobile Footer Navigation --- */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--sidebar-bg); /* Use sidebar background color */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 999; /* Ensure it's above other content */
    display: none; /* Hide on desktop by default */
    border-top: 1px solid var(--border-color);
}

.mobile-nav nav ul {
    list-style: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 5px 0; /* Reduced padding */
    margin: 0;
    width: 100%;
}

.mobile-nav nav li {
    flex-grow: 1; /* Make items take equal space */
}

.mobile-nav nav li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    padding: 5px 5px; /* Adjust padding */
    text-decoration: none;
    color: var(--text-muted); /* Muted color for inactive */
    font-size: 0.75rem; /* Smaller font size */
    text-align: center;
    transition: color 0.2s ease;
    height: 55px; /* Fixed height for consistent look */
}

.mobile-nav nav li a i {
    font-size: 1.25rem; /* Icon size */
    margin-bottom: 2px; /* Space between icon and text */
}

.mobile-nav nav li a:hover {
    color: var(--accent-color); /* Accent color on hover */
}

.mobile-nav nav li a.active {
    color: var(--accent-color); /* Accent color for active link */
    font-weight: 600;
}

/* Show footer only on smaller screens */
@media (max-width: 768px) {
    .mobile-nav {
        display: block; /* Show the footer */
    }
    .main-content {
        padding-bottom: 70px; /* Add padding to main content to prevent overlap */
    }
    main {
       padding-bottom: 10px; /* Adjust if content gets too close to footer */
    }
}

/* Adjust main content padding for pages that might have their own bottom padding */
@media (max-width: 768px) {
    body:has(#nagorikRegistrationApp) .main-content {
         padding-bottom: 80px; /* More padding for citizen reg page */
    }
     body:has(#warishApp) .main-content {
         padding-bottom: 80px; /* More padding for warish app page */
    }
}