/* Modern Styles for Khidmah Foundation */

@layer base {

    body,
    *:not(.fas):not(.far):not(.fab):not(.fa) {
        font-family: 'Baloo Da 2', sans-serif !important;
    }

    body {
        background-color: #EDEDCE;
        /* bg-surface */
        color: #0C2C55;
        /* text-primary */
        font-size: 1.125rem;
        /* text-lg */
        -webkit-font-smoothing: antialiased;
        font-size: 110%;
        line-height: 1.6;
        /* Ensure enough vertical space for Bengali diacritics */
    }
}

@layer components {
    .nav-link {
        display: flex !important;
        align-items: center;
        gap: 0.85rem;
        padding: 0.75rem 1rem;
        border-radius: 0.85rem;
        color: rgba(255, 255, 255, 0.5);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-weight: 700;
        font-size: 1.05rem;
        border: 1px solid transparent;
        position: relative;
        margin-right: 0.75rem;
    }

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.9);
        border-color: rgba(255, 255, 255, 0.05);
        transform: translateX(0.25rem);
    }

    .nav-link.active {
        background: linear-gradient(to right, rgba(41, 99, 116, 0.6), #296374);
        color: white;
        box-shadow: 0 10px 25px -5px rgba(41, 99, 116, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
        transform: translateX(0.5rem);
    }

    .nav-link i {
        width: 2.1rem;
        height: 2.1rem;
        display: flex !important;
        align-items: center;
        justify-content: center;
        line-height: 1;
        border-radius: 0.65rem;
        background-color: rgba(255, 255, 255, 0.05);
        font-size: 1.05rem;
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        flex-shrink: 0;
    }

    .nav-link:hover i {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
        transform: rotate(6deg) scale(1.1);
    }

    .nav-link.active i {
        background-color: white;
        color: #296374;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        transform: scale(1.1);
    }

    /* Active indicator */
    .nav-link.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 0.375rem;
        height: 2rem;
        background-color: white;
        border-top-right-radius: 9999px;
        border-bottom-right-radius: 9999px;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }

    .glass {
        backdrop-filter: blur(24px);
        background-color: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.4);
    }

    .glass-dark {
        backdrop-filter: blur(24px);
        background-color: rgba(12, 44, 85, 0.05);
        border: 1px solid rgba(12, 44, 85, 0.1);
    }

    .bengali {
        font-family: 'Baloo Da 2', cursive;
    }

    .btn-primary {
        background-color: #296374;
        /* secondary */
        color: white;
        font-weight: 900;
        border-radius: 1rem;
        padding: 1rem 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        font-size: 1.125rem;
        transition: all 0.3s;
    }

    .btn-primary:hover {
        background-color: #1D4956;
        /* secondary-dark */
        box-shadow: 0 20px 50px -15px rgba(41, 99, 116, 0.2);
    }

    .btn-primary:active {
        transform: scale(0.95);
    }

    .stat-card {
        background-color: white;
        padding: 2rem;
        border-radius: 2.5rem;
        border: 1px solid rgba(12, 44, 85, 0.05);
        /* primary/5 */
        box-shadow: 0 10px 40px -10px rgba(12, 44, 85, 0.08);
        /* shadow-premium */
        transition: all 0.5s;
    }

    .stat-card:hover {
        box-shadow: 0 20px 50px -15px rgba(41, 99, 116, 0.2);
        transform: translateY(-0.25rem);
    }

    /* Solid Colors for Stat Cards */
    .card-solid-primary {
        background-color: #0C2C55;
        /* Primary Navy */
        color: white !important;
        border: none;
    }

    .card-solid-secondary {
        background-color: #296374;
        /* Secondary Teal */
        color: white !important;
        border: none;
    }

    .card-solid-green {
        background-color: #059669;
        /* Green */
        color: white !important;
        border: none;
    }

    .card-solid-slate {
        background-color: #475569;
        /* Slate */
        color: white !important;
        border: none;
    }

    .card-solid-rose {
        background-color: #E11D48;
        /* Rose */
        color: white !important;
        border: none;
    }

    .card-solid-blue {
        background-color: #2563EB;
        /* Blue */
        color: white !important;
        border: none;
    }

    .input-field {
        width: 100%;
        padding: 1rem 1.5rem;
        background-color: rgba(12, 44, 85, 0.05);
        border: 1px solid transparent;
        border-radius: 1rem;
        transition: all 0.3s;
        font-size: 1.125rem;
        font-weight: 500;
        outline: none;
    }

    .input-field:focus {
        background-color: white;
        border-color: rgba(41, 99, 116, 0.2);
        box-shadow: 0 0 0 4px rgba(41, 99, 116, 0.1);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(12, 44, 85, 0.2);
    border-radius: 9999px;
    transition: background-color 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(12, 44, 85, 0.4);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(12, 44, 85, 0.2);
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(12, 44, 85, 0.4);
}

/* Page Transitions */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Micro-interactions */
.tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0.25rem;
    background-color: #0C2C55;
    /* primary */
    border-radius: 9999px;
    transition: all 0.3s;
}

/* Auth & Login Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.animate-shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes animate-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-in-from-bottom {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes zoom-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 0.1;
        transform: scale(1);
    }

    50% {
        opacity: 0.2;
        transform: scale(1.1);
    }
}

.animate-in {
    animation: animate-in var(--duration, 500ms) ease-out forwards;
}

.slide-in-from-bottom {
    animation: slide-in-from-bottom var(--duration, 700ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.zoom-in {
    animation: zoom-in var(--duration, 500ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse {
    animation: pulse-soft 4s ease-in-out infinite;
}

@keyframes chart-draw {
    from {
        stroke-dashoffset: var(--offset-start);
    }

    to {
        stroke-dashoffset: var(--offset-end);
    }
}

.animate-chart-draw {
    animation: chart-draw 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    stroke-dashoffset: var(--offset-start);
}

@keyframes chart-appear {
    from {
        opacity: 0;
        transform: scale(0.9) rotate(-110deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(-90deg);
    }
}

.animate-chart-appear {
    animation: chart-appear 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: center;
}