/* MPO Management System - Main Stylesheet
=================================================================== */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary-color: #106e33; /* Bangladesh Flag Green */
    --secondary-color: #f42a41; /* Bangladesh Flag Red */
    --dark-color: #1d2327;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    
    /* Status Colors */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Bootstrap Theme Override */
    --bs-primary: var(--primary-color);
    --bs-secondary: var(--secondary-color);
    --bs-success: var(--success-color);
    --bs-info: var(--info-color);
    --bs-warning: var(--warning-color);
    --bs-danger: var(--danger-color);
    
    /* Typography */
    --body-font: 'Poppins', 'Hind Siliguri', sans-serif;
    --heading-font: 'Poppins', 'Hind Siliguri', sans-serif;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 60px;
    --footer-height: 60px;
    --card-border-radius: 8px;
    --btn-border-radius: 4px;
    
    /* Shadows */
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --sidebar-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-speed: 0.3s;
}

/* Global Styles
=================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--body-font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all var(--transition-speed) ease;
}

a:hover {
    color: #0d5526;
}

/* Buttons & Forms Override */
.btn {
    border-radius: var(--btn-border-radius);
    font-weight: 500;
    padding: .375rem 1rem;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0d5526;
    border-color: #0d5526;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #d0172c;
    border-color: #d0172c;
}

.form-control, .form-select {
    font-size: 14px;
    border-radius: var(--btn-border-radius);
    padding: .5rem .75rem;
}

.form-control:focus, 
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(16, 110, 51, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: .5rem;
}

.card {
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    border: none;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--white-color);
    border-bottom: 1px solid var(--light-gray);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.table {
    font-size: 14px;
}

.table thead th {
    font-weight: 600;
    background-color: #f8f9fa;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slideInUp {
    animation: slideInUp 0.5s ease-in-out;
}

/* Login Page
=================================================================== */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    background-image: url('../images/bg-pattern.png');
    background-size: 500px;
    background-repeat: repeat;
    opacity: 0.05;
    animation: backgroundMove 60s linear infinite;
}

@keyframes backgroundMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 500px 500px;
    }
}

.login-card {
    background-color: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    position: relative;
    z-index: 10;
    border-top: 4px solid var(--primary-color);
}

.govt-logo {
    height: 80px;
    margin-bottom: 1rem;
}

.login-form {
    margin-top: 1.5rem;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-color);
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 12px;
    color: var(--gray-color);
}

/* Dashboard Layout
=================================================================== */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: auto;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--white-color);
    box-shadow: var(--sidebar-shadow);
    z-index: 1000;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-logo {
    height: 40px;
    margin-right: 10px;
}

.sidebar-header h5 {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
}

.sidebar-user {
    padding: 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.sidebar-user .user-name {
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 12px;
    color: var(--gray-color);
    white-space: nowrap;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    padding: 0.75rem 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-nav .nav-item.active .nav-link,
.sidebar-nav .nav-link:hover {
    background-color: rgba(16, 110, 51, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: auto;
}

/* Navbar */
.navbar {
    height: var(--navbar-height);
    border-bottom: 1px solid var(--light-gray);
    padding: 0 1.5rem;
    z-index: 100;
}

.page-title {
    font-size: 18px;
    font-weight: 500;
}

.user-dropdown {
    display: flex;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.notification-dropdown {
    width: 300px;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--light-gray);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0;
}

.notification-item .icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    margin-right: 10px;
}

.notification-item .content {
    flex: 1;
}

.notification-item p {
    margin-bottom: 0.25rem;
    font-size: 13px;
}

.notification-item span {
    font-size: 11px;
    color: var(--gray-color);
}

.dropdown-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid var(--light-gray);
}

.dropdown-footer a {
    font-size: 13px;
    font-weight: 500;
}

/* Page Content */
.main-content > .container-fluid {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    height: calc(100vh - var(--navbar-height) - var(--footer-height));
}

/* Footer */
.footer {
    height: var(--footer-height);
    display: flex;
    align-items: center;
    border-top: 1px solid var(--light-gray);
    padding: 0 1.5rem;
    background-color: var(--white-color);
    font-size: 12px;
    color: var(--gray-color);
}

/* Dashboard Components
=================================================================== */

/* Stats Cards */
.stat-card {
    background-color: var(--white-color);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.25rem;
    display: flex;
    min-height: 140px;
}

.stat-card-info {
    flex: 1;
    display: flex;
    gap: 15px;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    color: var(--white-color);
}

.stat-card-title {
    font-size: 14px;
    color: var(--gray-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-card-change {
    font-size: 12px;
    font-weight: 500;
    margin-right: 5px;
}

.stat-card-change.positive {
    color: var(--success-color);
}

.stat-card-change.negative {
    color: var(--danger-color);
}

.stat-card-chart {
    width: 30%;
    height: 100%;
}

/* MPO Status Timeline */
.mpo-status-timeline {
    position: relative;
    padding: 1rem 0;
}

.mpo-status-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background-color: var(--light-gray);
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--white-color);
}

.timeline-item.completed .timeline-icon {
    background-color: var(--success-color);
}

.timeline-item.active .timeline-icon {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

.timeline-content {
    background-color: var(--white-color);
    padding: 1rem;
    border-radius: var(--card-border-radius);
    border-left: 3px solid var(--light-gray);
}

.timeline-item.completed .timeline-content {
    border-left-color: var(--success-color);
}

.timeline-item.active .timeline-content {
    border-left-color: var(--primary-color);
}

.timeline-content h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timeline-content p {
    margin-bottom: 0.5rem;
    color: var(--gray-color);
}

.timeline-date {
    font-size: 12px;
    color: var(--gray-color);
}

/* Activity List */
.activity-list {
    height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid var(--light-gray);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    margin-right: 15px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 12px;
    color: var(--gray-color);
}

/* Approval Table */
.approval-table {
    margin-bottom: 0;
}

.approval-table th, 
.approval-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Policy Insights List */
.policy-insights-list {
    max-height: 400px;
    overflow-y: auto;
}

.policy-item {
    display: flex;
    align-items: flex-start;
    padding: 1.25rem;
    border-bottom: 1px solid var(--light-gray);
}

.policy-item:last-child {
    border-bottom: none;
}

.policy-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    margin-right: 15px;
    flex-shrink: 0;
}

.policy-content h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.policy-content p {
    margin-bottom: 0;
    color: var(--gray-color);
    font-size: 13px;
}

/* Bottleneck Analysis */
.bottleneck-analysis {
    padding: 1rem;
}

.bottleneck-item {
    margin-bottom: 1.5rem;
}

.bottleneck-item:last-child {
    margin-bottom: 0;
}

/* Policy Reports Table */
.policy-reports-table th,
.policy-reports-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Regional Status Table */
.regional-status-table th,
.regional-status-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Action Items List */
.action-items-list {
    max-height: 400px;
    overflow-y: auto;
}

.action-item {
    display: flex;
    padding: 1.25rem;
    border-bottom: 1px solid var(--light-gray);
}

.action-item:last-child {
    border-bottom: none;
}

.action-item.urgent {
    background-color: rgba(220, 53, 69, 0.05);
}

.action-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
    margin-right: 15px;
    flex-shrink: 0;
}

.action-content {
    flex: 1;
}

.action-content h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.action-content p {
    margin-bottom: 1rem;
    color: var(--gray-color);
    font-size: 13px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* MPO Category Breakdown */
.mpo-category-breakdown {
    padding: 1rem;
}

.mpo-category-item {
    margin-bottom: 1.25rem;
}

.mpo-category-item:last-child {
    margin-bottom: 0;
}

/* Application Status Cards */
.application-status-card {
    background-color: var(--white-color);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.status-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--white-color);
    margin-right: 15px;
}

.status-icon.submitted {
    background-color: var(--primary-color);
}

.status-icon.verification {
    background-color: var(--warning-color);
}

.status-icon.review {
    background-color: var(--info-color);
}

.status-icon.completed {
    background-color: var(--success-color);
}

.status-content {
    flex: 1;
}

.status-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.status-content p {
    margin-bottom: 0.5rem;
    color: var(--gray-color);
}

.status-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
}

.status-badge.increase {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-badge.decrease {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

/* Progress Tracker */
.progress-tracker {
    margin-top: 1.5rem;
}

/* Institution Applications Table */
.institution-applications-table th,
.institution-applications-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Status Flags List */
.status-flags-list {
    max-height: 450px;
    overflow-y: auto;
}

.status-flag-item {
    display: flex;
    padding: 1.25rem;
    border-bottom: 1px solid var(--light-gray);
}

.status-flag-item:last-child {
    border-bottom: none;
}

.status-flag-item.critical {
    background-color: rgba(220, 53, 69, 0.05);
}

.status-flag-item.warning {
    background-color: rgba(255, 193, 7, 0.05);
}

.status-flag-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.status-flag-item.critical .status-flag-icon {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.status-flag-item.warning .status-flag-icon {
    color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.status-flag-item.info .status-flag-icon {
    color: var(--info-color);
    background-color: rgba(23, 162, 184, 0.1);
}

.status-flag-content {
    flex: 1;
}

.status-flag-content h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.status-flag-content p {
    margin-bottom: 0;
    color: var(--gray-color);
    font-size: 13px;
}

/* Compliance Summary */
.compliance-summary {
    padding: 1rem;
}

.compliance-item {
    margin-bottom: 1.25rem;
}

.compliance-item:last-child {
    margin-bottom: 0;
}

/* Activity Audit Log */
.activity-audit-log {
    max-height: 450px;
    overflow-y: auto;
}

.timeline {
    position: relative;
    padding: 1rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 80px;
    width: 2px;
    background-color: var(--light-gray);
}

.timeline-item {
    position: relative;
    padding-left: 110px;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    position: absolute;
    left: 0;
    top: 0;
    width: 70px;
    text-align: right;
    font-size: 12px;
    color: var(--gray-color);
}

.timeline-content {
    display: flex;
    background-color: var(--white-color);
    padding: 1rem;
    border-radius: var(--card-border-radius);
    border-left: 3px solid var(--light-gray);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timeline-icon {
    position: absolute;
    left: 71px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--white-color);
}

.timeline-details {
    flex: 1;
}

.timeline-details h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timeline-details p {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.timeline-user {
    font-size: 12px;
    color: var(--gray-color);
}

/* Responsive
=================================================================== */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 1050;
        width: 80%;
        max-width: 300px;
        transition: all 0.3s ease;
        box-shadow: none;
    }
    
    .sidebar.show {
        left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Overlay when sidebar is shown */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 1040;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 767.98px) {
    .stat-card {
        flex-direction: column;
    }
    
    .stat-card-chart {
        width: 100%;
        height: 100px;
        margin-top: 1rem;
    }
}

/* Content Section Styles */
#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Animations
=================================================================== */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Customized DataTables */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_info, 
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.25rem 0.5rem;
    margin: 0 0.25rem;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white-color) !important;
}

/* Modal Styles */
.modal-content {
    border-radius: var(--card-border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.modal-header {
    border-bottom: 1px solid var(--light-gray);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--light-gray);
    padding: 1rem 1.5rem;
}

/* Bootstrap Badge Override */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 4px;
}