/* assets/css/style.css */
/* Material Symbols enabled */

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

:root {
    --primary-color: #10b981;
    /* Vibrant OkCredit Green */
    --primary-hover: #059669;
    --bg-main: #f3f4f6;
    /* Light gray background */
    --bg-card: #ffffff;
    /* pure white cards */
    --text-main: #1f2937;
    /* Very dark gray text */
    --text-muted: #6b7280;
    /* lighter gray */
    --border-color: #e5e7eb;

    --accent-cyan: #0ea5e9;
    --accent-indigo: #6366f1;
    --accent-rose: #f43f5e;
    --accent-emerald: #10b981;
    --accent-warning: #f59e0b;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Base Overrides for Light Theme Migration */
.text-dark {
    color: var(--text-main) !important;
}

.text-secondary {
    color: var(--text-muted) !important;
}

.bg-white {
    background-color: var(--bg-card) !important;
}

.border-opacity-10 {
    border-color: var(--border-color) !important;
}

/* Modern Card (replaces glass-effect) */
.modern-card,
.glass-effect {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeUp 0.6s ease-out forwards;
}

.modern-card:hover,
.glass-effect:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Dashboard Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    padding: 0;
    z-index: 1000;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    height: 70px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.sidebar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

#sidebarCollapse {
    background: #ffffff;
    border: 1px solid var(--border-color);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    color: var(--text-muted);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#sidebarCollapse:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.nav-link {
    color: var(--text-muted);
    padding: 10px 16px;
    margin: 4px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
}

.nav-link i {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
    transform: translateX(4px);
}

.nav-link.active {
    color: white !important;
    background: var(--primary-color) !important;
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.4);
}

.nav-link.active i {
    color: white !important;
}

.sidebar-submenu {
    padding: 5px 0 10px 12px;
    background: transparent;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sidebar Toggle State (Desktop Iconic Mode) */
@media (min-width: 992px) {
    .sidebar.collapsed {
        width: 80px;
        left: 0;
    }

    .sidebar.collapsed .sidebar-header {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
        gap: 15px;
    }

    .sidebar.collapsed .sidebar-brand span,
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed small,
    .sidebar.collapsed .sidebar-submenu {
        display: none !important;
    }

    /* Hide any raw text nodes in nav-links */
    .sidebar.collapsed .nav-link {
        font-size: 0 !important;
        justify-content: center;
        margin: 5px 12px;
        padding: 0;
        height: 48px;
        gap: 0;
    }

    .sidebar.collapsed .nav-link i {
        font-size: 1.4rem !important;
        margin: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .sidebar.collapsed #sidebarCollapse {
        display: flex;
        background: #f1f5f9;
    }

    .sidebar.collapsed #sidebarCollapse i {
        transform: rotate(180deg);
    }

    .sidebar.collapsed .nav-link:hover {
        transform: none;
    }

    .main-content.expanded {
        margin-left: 80px;
    }
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 75px;
    }

    .sidebar {
        left: -260px;
        z-index: 1100;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        display: block !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px;
        padding-bottom: 100px;
    }

    /* Sidebar active state */
    .sidebar.active {
        left: 0 !important;
    }

    /* Global Bottom Navigation Styles */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 75px;
        background: #ffffff !important;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
        z-index: 10000 !important;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted) !important;
        text-decoration: none !important;
        flex: 1;
        height: 100%;
        transition: all 0.3s ease;
        gap: 2px;
    }

    .bottom-nav-item i {
        font-size: 1.4rem;
        display: block;
    }

    .bottom-nav-item span {
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .bottom-nav-item.active {
        color: var(--primary-color) !important;
    }

    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }

    .d-flex.justify-content-between.align-items-center>div {
        width: 100%;
    }

    h2.fw-bold {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 767.98px) {
    .stat-card {
        padding: 15px;
        gap: 15px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .stat-info h3 {
        font-size: 1.4rem;
    }

    .modern-card {
        padding: 15px !important;
    }

    .table thead th,
    .table tbody td {
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* Dashboard Cards */
.stat-card {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
}

.icon-blue {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-cyan);
}

.icon-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.icon-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.icon-rose {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

.icon-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

.stat-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Custom Table Overrides */
.table {
    color: var(--text-main);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table thead th {
    background-color: #f9fafb !important;
    border-bottom: 2px solid var(--border-color) !important;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.04) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.table tbody td {
    border-bottom: 1px solid var(--border-color) !important;
    vertical-align: middle;
    color: var(--text-main) !important;
    white-space: nowrap;
}

/* Custom Standard Controls */
.custom-form-control {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 10px 15px;
}

.custom-form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    /* No dark background on focus */
    background: #ffffff !important;
    color: var(--text-main) !important;
}

/* Fix Input texts and placeholder colors across the app */
.form-control,
.form-select,
.custom-form-control,
input,
textarea {
    color: var(--text-main) !important;
    font-family: inherit;
    background-color: #ffffff !important;
    border-color: var(--border-color) !important;
}

.input-group-text {
    background-color: #f9fafb !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

.form-control::placeholder,
.custom-form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #6b7280 !important;
    /* Tailwind Gray-500 */
    opacity: 1 !important;
}

/* Ensure selects don't keep dark options */
.custom-form-control option {
    background-color: #ffffff;
    color: var(--text-main);
}

/* Landing Page Styles */
.landing-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.landing-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.portal-card {
    padding: 40px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.portal-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.portal-card i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
    background: -webkit-linear-gradient(135deg, var(--primary-color), #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-card h4 {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.portal-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Auth Cards */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f4f6;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    z-index: 10;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.btn-primary-custom {
    background: var(--primary-color);
    color: white !important;
    border: none;
    padding: 12px;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-primary-custom:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

/* Utilities to fix specific dark mode colors from inline styles */
.bg-dark.bg-opacity-25,
.bg-dark.bg-opacity-50 {
    background-color: #f9fafb !important;
    border: 1px solid var(--border-color) !important;
}

.text-white,
.text-light {
    color: var(--text-main) !important;
}

.text-white-50 {
    color: var(--text-muted) !important;
}

.opacity-75 {
    opacity: 1 !important;
    color: var(--text-muted) !important;
}

/* Ensure badges inside dark override don't lose color */
.badge.bg-success {
    background-color: var(--accent-emerald) !important;
    color: white !important;
}

.badge.bg-danger {
    background-color: var(--accent-rose) !important;
    color: white !important;
}

.badge.bg-warning {
    background-color: var(--accent-warning) !important;
    color: white !important;
}

.badge.bg-info {
    background-color: var(--accent-cyan) !important;
    color: white !important;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.badge.bg-secondary {
    background-color: #e5e7eb !important;
    color: var(--text-main) !important;
}

/* Modal Light Theme Override */
.modal-content {
    background: #ffffff !important;
    border-radius: 16px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header,
.modal-footer {
    border-color: var(--border-color) !important;
}

.modal-title {
    color: var(--text-main) !important;
    font-weight: 800;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Offcanvas custom animation */
.offcanvas {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.offcanvas.show {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Top Nav Overrides */
.navbar .search-bar-input {
    background: #f3f4f6 !important;
    border-color: transparent !important;
    color: var(--text-main) !important;
}

.navbar .nav-link {
    color: var(--text-muted) !important;
}

.navbar .nav-link:hover {
    color: var(--text-main) !important;
}

.dropdown-menu {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: var(--text-main) !important;
}

.dropdown-item:hover {
    background: #f3f4f6 !important;
}

.dropdown-divider {
    border-color: var(--border-color) !important;
}

.btn.text-white,
.btn .text-white,
.btn.text-light,
.btn .text-light,
.badge.text-white,
.badge .text-white,
.badge.text-light,
.badge .text-light {
    color: #ffffff !important;
}

/* Animations */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Micro-interactions & Professional Icons */
i[class^="fa-"],
i[class*=" fa-"] {
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

button:hover i,
a:hover i,
.hover-lift:hover i {
    opacity: 1;
}

.btn,
.portal-card,
.hover-lift {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:active,
.portal-card:active,
.hover-lift:active {
    transform: scale(0.96) !important;
}

/* Base animations for content blocks */
.modern-card,
.table,
form,
.notice-card,
.timeline-card,
.class-card {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Stagger grid items */
.row>div:nth-child(1) {
    animation-delay: 0.05s;
}

.row>div:nth-child(2) {
    animation-delay: 0.1s;
}

.row>div:nth-child(3) {
    animation-delay: 0.15s;
}

.row>div:nth-child(4) {
    animation-delay: 0.2s;
}

.row>div:nth-child(5) {
    animation-delay: 0.25s;
}

.row>div:nth-child(6) {
    animation-delay: 0.3s;
}

.row>div:nth-child(n+7) {
    animation-delay: 0.35s;
}

/* Stagger table rows */
tbody tr {
    animation: fadeUp 0.4s ease-out backwards;
}

tbody tr:nth-child(1) {
    animation-delay: 0.1s;
}

tbody tr:nth-child(2) {
    animation-delay: 0.15s;
}

tbody tr:nth-child(3) {
    animation-delay: 0.2s;
}

tbody tr:nth-child(4) {
    animation-delay: 0.25s;
}

tbody tr:nth-child(5) {
    animation-delay: 0.3s;
}

tbody tr:nth-child(n+6) {
    animation-delay: 0.35s;
}