/* Custom Styles for EIS Application - UNICEF Brand Compliant */
/* File: public/custom/css/custom.css */

:root {
    /* UNICEF Brand Colors */
    --unicef-blue: #1CABE2;          /* Primary */
    --unicef-dark-blue: #00558C;     /* Supporting Dark */
    --unicef-light-blue: #D2EEF9;    /* Background Use */
    --unicef-green: #80BD41;         /* Supporting Green */
    --unicef-red: #E2231A;           /* Alert/Error */
    --unicef-orange: #F26A21;        /* Supporting Orange */
    --unicef-yellow: #FFC72C;        /* Supporting Yellow */
    --unicef-purple: #961A49;        /* Supporting Purple */
    --unicef-grey: #6B6C6E;          /* Text */
    --unicef-light-grey: #ECECEC;    /* Background */
    --unicef-dark-grey: #2D2926;     /* Dark Text/Icon */

    /* Layout Variables */
    --primary-color: var(--unicef-blue);
    --primary-hover: var(--unicef-dark-blue);
    --sidebar-width: 250px;
    --header-height: 60px;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ===================
   GLOBAL ELEMENTS
=================== */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fc;
}

* {
    transition: var(--transition);
}

/* ===================
   HEADER / NAVBAR
=================== */

.main-header {
    background: linear-gradient(135deg, var(--unicef-blue), var(--unicef-dark-blue));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
    border-bottom: none;
}

.main-header .navbar-nav .nav-link {
    color: white !important;
}

.main-header .navbar-nav .nav-link:hover {
    color: #e0e0e0 !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* User dropdown */
.user-menu .dropdown-toggle {
    padding: 8px 12px;
    border-radius: var(--border-radius);
}

.user-menu .dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-image {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-image:hover {
    border-color: white;
}

/* ===================
   DROPDOWN / BRAND SELECTOR
=================== */

.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
}

.dropdown-item {
    padding: 10px 20px;
}

.dropdown-item:hover {
    background-color: var(--unicef-blue);
    color: white;
}

.brand-selector {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--border-radius);
}

.brand-selector:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===================
   SEARCH / TIME / FOOTER
=================== */

#inf_search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--unicef-light-grey);
    border-radius: var(--border-radius);
    font-size: 14px;
}

#inf_search:focus {
    outline: none;
    border-color: var(--unicef-blue);
    box-shadow: 0 0 0 2px rgba(28, 171, 226, 0.2);
}

.time-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    color: white;
    font-weight: 500;
    margin-right: 10px;
    border-radius: var(--border-radius);
}

.main-footer {
    background: var(--unicef-dark-grey);
    color: var(--unicef-light-grey);
    padding: 20px;
    margin-left: var(--sidebar-width);
    border-top: none;
}

.main-footer a {
    color: var(--unicef-blue);
    text-decoration: none;
}

.main-footer a:hover {
    color: var(--unicef-light-blue);
    text-decoration: underline;
}

/* ===================
   CARDS / BREADCRUMBS
=================== */

.card {
    margin-top: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--unicef-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--unicef-blue), var(--unicef-dark-blue));
    color: #fff;
    border-bottom: 1px solid var(--unicef-blue);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.breadcrumb {
    background: linear-gradient(135deg, var(--unicef-blue), var(--unicef-light-blue));
    border-radius: var(--border-radius);
    color: white;
    border: 1px solid var(--unicef-blue);
    padding: 0.5rem 1rem;
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-item a {
    color: white;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ===================
   FORM / TABLES / ALERTS
=================== */

.form-control {
    border-radius: var(--border-radius);
    border-color: var(--unicef-light-grey);
}

.form-control:focus {
    border-color: var(--unicef-blue);
    box-shadow: 0 0 0 0.2rem rgba(28, 171, 226, 0.25);
}

.required,
.help-block {
    color: var(--unicef-red);
}

.required::after {
    content: " *";
    color: var(--unicef-red);
    font-weight: bold;
}

.help-block {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-style: italic;
}

/* .table thead th {
    background-color: var(--unicef-blue);
    color: white;
    border-top: none;
    border-bottom: 2px solid var(--unicef-dark-blue);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
} */

/* Remove border from first column */
/* .table thead th:first-child {
    border-left: none;
} */

/* Remove border from last column */
/* .table thead th:last-child {
    border-right: none;
} */

/* Optional: Add subtle borders to table body cells for consistency */
.table tbody td {
    border-left: 1px solid var(--unicef-light-grey);
    border-right: 1px solid var(--unicef-light-grey);
}

/* .table tbody td:first-child {
    border-left: none;
}

.table tbody td:last-child {
    border-right: none;
} */

/* Alerts */
.alert-primary {
    background-color: rgba(28, 171, 226, 0.1);
    border-color: var(--unicef-blue);
    color: var(--unicef-dark-blue);
}

.alert-success {
    background-color: rgba(128, 189, 65, 0.1);
    border-color: var(--unicef-green);
    color: #2d5016;
}

.alert-warning {
    background-color: rgba(255, 199, 44, 0.1);
    border-color: var(--unicef-yellow);
    color: #664d00;
}

.alert-danger {
    background-color: rgba(226, 35, 26, 0.1);
    border-color: var(--unicef-red);
    color: #721c1c;
}

.alert-info {
    background-color: rgba(0, 174, 239, 0.1);
    border-color: var(--unicef-dark-blue);
    color: #0c5460;
}

/* ===================
   BUTTONS / BADGES / PROGRESS
=================== */

.btn {
    border-radius: var(--border-radius);
}

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

.btn-primary:hover {
    background-color: var(--unicef-dark-blue);
    border-color: var(--unicef-dark-blue);
}

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

.btn-secondary:hover {
    background-color: var(--unicef-dark-grey);
    border-color: var(--unicef-dark-grey);
}

.btn-success {
    background-color: var(--unicef-green);
    border-color: var(--unicef-green);
}

.btn-warning {
    background-color: var(--unicef-yellow);
    border-color: var(--unicef-yellow);
    color: var(--unicef-dark-grey);
}

.btn-danger {
    background-color: var(--unicef-red);
    border-color: var(--unicef-red);
}

.btn-info {
    background-color: var(--unicef-dark-blue);
    border-color: var(--unicef-dark-blue);
}

/* Badges */
.badge-primary { background-color: var(--unicef-blue); }
.badge-secondary { background-color: var(--unicef-grey); }
.badge-success { background-color: var(--unicef-green); }
.badge-warning {
    background-color: var(--unicef-yellow);
    color: var(--unicef-dark-grey);
}
.badge-danger { background-color: var(--unicef-red); }
.badge-info { background-color: var(--unicef-dark-blue); }

/* Progress bars */
.progress-bar { background-color: var(--unicef-blue); }
.progress-bar-success { background-color: var(--unicef-green); }
.progress-bar-warning { background-color: var(--unicef-yellow); }
.progress-bar-danger { background-color: var(--unicef-red); }
.progress-bar-info { background-color: var(--unicef-light-blue); }

/* ===================
   CONTENT WRAPPER
=================== */

.content-wrapper {
    margin-left: var(--sidebar-width);
    /* padding-top: var(--header-height); */
    min-height: calc(100vh - var(--header-height));
}

/* ===================
   LOADING / ANIMATION
=================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================
   RESPONSIVE
=================== */

@media (max-width: 768px) {
    .content-wrapper,
    .main-footer {
        margin-left: 0;
    }

    .time-display,
    .d-none.d-md-inline {
        display: none !important;
    }

    .card {
        margin-top: 0.25rem;
    }

    .breadcrumb {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}


/* ===================
   NAV PILLS - UNICEF BRAND COMPLIANT
=================== */

.nav-pills .nav-link {
    color: var(--unicef-grey);
    border-radius: var(--border-radius);
    padding: 10px 10px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: var(--unicef-blue);
    border-color: var(--unicef-dark-blue);
    font-weight: 600;
}

.nav-pills .nav-link:not(.active):hover {
    color: var(--unicef-dark-blue);
    background-color: rgba(28, 171, 226, 0.1);
    border-color: var(--unicef-light-blue);
}

.nav-pills .nav-link:not(.active):focus {
    color: var(--unicef-blue);
    background-color: rgba(28, 171, 226, 0.1);
    border-color: var(--unicef-blue);
    box-shadow: 0 0 0 2px rgba(28, 171, 226, 0.15);
}

/* ===================
   LOGIN PAGE - CLEAN & SIMPLE
=================== */

/* Override the guest layout background */
.font-sans.text-gray-900.antialiased {
    background: linear-gradient(135deg, var(--unicef-light-blue) 0%, #ffffff 50%, var(--unicef-light-blue) 100%) !important;
    min-height: 100vh !important;
}

/* Style the auth card container */
.mt-6.max-w-md.mx-auto.bg-white.shadow-md.rounded-lg.p-6 {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(28, 171, 226, 0.2) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transition: var(--transition) !important;
    padding: 2rem !important;
}

.mt-6.max-w-md.mx-auto.bg-white.shadow-md.rounded-lg.p-6:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) !important;
}

/* Style the logo and title section */
.flex.flex-col.items-center a {
    color: var(--unicef-dark-blue) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.flex.flex-col.items-center img {
    border-radius: var(--border-radius) !important;
    border: 3px solid rgba(255, 255, 255, 1) !important;
    box-shadow: 0 4px 10px rgba(28, 171, 226, 0.2) !important;
    transition: var(--transition) !important;
}

.flex.flex-col.items-center img:hover {
    transform: scale(1.02) !important;
    box-shadow: 0 6px 15px rgba(28, 171, 226, 0.3) !important;
}

/* Style form labels */
.block.text-gray-700.font-semibold.mb-1 {
    color: var(--unicef-dark-grey) !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    font-size: 14px !important;
}

/* Style input fields */
.w-full[type="text"],
.w-full[type="password"] {
    border: 2px solid var(--unicef-light-grey) !important;
    border-radius: var(--border-radius) !important;
    height: 44px !important;
    padding: 0 14px !important;
    font-size: 16px !important;
    transition: var(--transition) !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

.w-full[type="text"]:focus,
.w-full[type="password"]:focus {
    border-color: var(--unicef-blue) !important;
    box-shadow: 0 0 0 3px rgba(28, 171, 226, 0.1) !important;
    background: rgba(255, 255, 255, 1) !important;
    outline: none !important;
}

/* Style the remember me checkbox */
input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    border: 2px solid var(--unicef-light-grey) !important;
    border-radius: 3px !important;
    accent-color: var(--unicef-blue) !important;
}

input[type="checkbox"]:checked {
    background-color: var(--unicef-blue) !important;
    border-color: var(--unicef-blue) !important;
}

input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(28, 171, 226, 0.2) !important;
}

/* Style the checkbox label */
.ml-2.text-sm.text-gray-600 {
    color: var(--unicef-grey) !important;
    font-size: 14px !important;
}

/* Style the forgot password link */
.text-sm.text-indigo-600.hover\:underline {
    color: var(--unicef-blue) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: var(--transition) !important;
}

.text-sm.text-indigo-600.hover\:underline:hover {
    color: var(--unicef-dark-blue) !important;
    text-decoration: underline !important;
}

/* Style the login button */
.bg-indigo-600.hover\:bg-indigo-700.text-white.px-4.py-2.rounded-md {
    background: var(--unicef-blue) !important;
    border: none !important;
    border-radius: var(--border-radius) !important;
    height: 44px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    transition: var(--transition) !important;
    padding: 0 20px !important;
    box-shadow: 0 2px 5px rgba(28, 171, 226, 0.3) !important;
}

.bg-indigo-600.hover\:bg-indigo-700.text-white.px-4.py-2.rounded-md:hover {
    background: var(--unicef-dark-blue) !important;
    box-shadow: 0 4px 10px rgba(28, 171, 226, 0.4) !important;
}

.bg-indigo-600.hover\:bg-indigo-700.text-white.px-4.py-2.rounded-md:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 5px rgba(28, 171, 226, 0.3) !important;
}

/* Style the download app link */
.flex.flex-col.items-center.text-indigo-600.hover\:text-indigo-700 {
    border: 2px solid var(--unicef-light-grey) !important;
    border-radius: var(--border-radius) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    color: var(--unicef-grey) !important;
    font-weight: 500 !important;
    padding: 10px 20px !important;
    transition: var(--transition) !important;
    text-decoration: none !important;
    margin-top: 1rem !important;
}

.flex.flex-col.items-center.text-indigo-600.hover\:text-indigo-700:hover {
    border-color: var(--unicef-green) !important;
    background: rgba(128, 189, 65, 0.05) !important;
    color: var(--unicef-dark-grey) !important;
}

/* Style success messages */
.mb-4.text-green-600 {
    background: rgba(128, 189, 65, 0.1) !important;
    border: 1px solid var(--unicef-green) !important;
    border-radius: var(--border-radius) !important;
    color: #2d5016 !important;
    padding: 12px !important;
}

/* Style error messages */
.mb-4.text-red-600 {
    background: rgba(226, 35, 26, 0.1) !important;
    border: 1px solid var(--unicef-red) !important;
    border-radius: var(--border-radius) !important;
    color: #721c1c !important;
    padding: 12px !important;
}

/* Style the security warning */
.mb-4.text-center.text-red-600.text-sm {
    background: rgba(255, 199, 44, 0.1) !important;
    border: 1px solid var(--unicef-yellow) !important;
    border-radius: var(--border-radius) !important;
    padding: 10px !important;
    color: #b45309 !important;
    margin-bottom: 1.5rem !important;
    font-size: 13px !important;
}

/* Override auth validation errors styling */
.mb-4.p-4.bg-red-100.border.border-red-300.text-red-800.rounded {
    background: rgba(226, 35, 26, 0.1) !important;
    border: 1px solid var(--unicef-red) !important;
    border-radius: var(--border-radius) !important;
    color: #721c1c !important;
    padding: 12px !important;
}

.mb-4.p-4.bg-red-100.border.border-red-300.text-red-800.rounded .font-semibold {
    color: var(--unicef-red) !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

.mb-4.p-4.bg-red-100.border.border-red-300.text-red-800.rounded ul {
    margin-top: 8px !important;
    color: #721c1c !important;
}

/* Override auth session status styling */
.mb-4.p-4.bg-green-100.border.border-green-300.text-green-800.rounded.text-sm {
    background: rgba(128, 189, 65, 0.1) !important;
    border: 1px solid var(--unicef-green) !important;
    border-radius: var(--border-radius) !important;
    color: #2d5016 !important;
    padding: 12px !important;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .mt-6.max-w-md.mx-auto.bg-white.shadow-md.rounded-lg.p-6 {
        margin: 16px !important;
        padding: 1.5rem !important;
    }

    .flex.flex-col.items-center img {
        width: 60px !important;
        height: 60px !important;
    }

    .w-full[type="text"],
    .w-full[type="password"],
    .bg-indigo-600.hover\:bg-indigo-700.text-white.px-4.py-2.rounded-md {
        height: 42px !important;
        font-size: 15px !important;
    }

    .block.text-gray-700.font-semibold.mb-1 {
        font-size: 13px !important;
    }
}
