﻿@tailwind base;
@tailwind components;
@tailwind utilities;
.font-inter { font-family: 'Inter', sans-serif; }

html, body {
    overflow-x: hidden;
}
@keyframes fadeIn {
    from {
        background-color: rgba(0,0,0,0);
    }

    to {
        background-color: rgba(0,0,0,0.4);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s forwards;
}

@keyframes slideIn {
    0% {
        transform: translateX(1.5rem);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bar {
    0%, 100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1);
    }
}


.animate-slideIn {
    animation: slideIn 0.4s forwards;
}

/* Tailwind delay utilities */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}


@keyframes slideFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideFadeIn {
    animation: slideFadeIn 0.3s forwards;
}


/*for ps shake*/
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20%, 60% {
        transform: translateX(-6px);
    }

    40%, 80% {
        transform: translateX(6px);
    }
}

.animate-shake {
    animation: shake 0.3s ease;
}


@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }

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

.animate-loading-bar {
    width: 40%;
    animation: loading-bar 1.2s infinite ease-in-out;
}


.cloudwi-shimmer-bar {
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient( 90deg, rgba(77, 175, 255, 0) 0%, /* Transparent */
    rgba(77, 175, 255, 0.7) 30%, /* Cloudwi Blue */
    rgba(168, 221, 255, 1) 60%, /* Neon Highlight */
    rgba(117, 199, 255, 0.7) 90%, /* Cloudwi Light Blue */
    rgba(77, 175, 255, 0) 100% /* Transparent */
    );
    animation: cloudwi-shimmer 1.15s infinite ease-in-out;
    filter: drop-shadow(0 0 4px #A8DDFF);
    border-radius: 100px;
}

@keyframes cloudwi-shimmer {
    0% {
        transform: translateX(-70%);
    }

    100% {
        transform: translateX(200%);
    }
}


/* Slide + Fade animation */
.left-panel-enter {
    opacity: 0;
    transform: translateX(-25px);
}

.left-panel-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.left-panel-exit-active {
    opacity: 0;
    transform: translateX(-25px);
    transition: opacity 0.20s ease, transform 0.20s ease;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.animate-fadein {
    animation: fadein 0.4s ease-out forwards;
}

/* Allows staggered animation */
[class*="animation-delay-"] {
    animation-fill-mode: both;
}

.animation-delay-0ms {
    animation-delay: 0ms;
}

.animation-delay-100ms {
    animation-delay: 100ms;
}

.animation-delay-200ms {
    animation-delay: 200ms;
}

.animation-delay-300ms {
    animation-delay: 300ms;
}

.animation-delay-400ms {
    animation-delay: 400ms;
}

.animation-delay-500ms {
    animation-delay: 500ms;
}

.animation-delay-600ms {
    animation-delay: 600ms;
}

.animation-delay-700ms {
    animation-delay: 700ms;
}

.animation-delay-800ms {
    animation-delay: 800ms;
}

.animation-delay-900ms {
    animation-delay: 900ms;
}


/*cloudwi-dual-loader*/
.cloudwi-dual-loader {
    position: relative;
    width: 80px;
    height: 80px;
}

.cloudwi-circle {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

    .cloudwi-circle.cloud {
        background: #3ba6e0; /* Sky blue */
    }

    .cloudwi-circle.we {
        background: #ff7f42; /* Orange */
    }

.cloudwi-orbit {
    position: absolute;
    inset: 0;
    animation: cloudwi-orbit 1.6s linear infinite;
    transform-origin: center center;
}

@keyframes cloudwi-orbit {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.font-grid {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
}



@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

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


@keyframes fadeInSlow {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

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

.animate-fadeInSlow {
    animation: fadeInSlow 0.25s ease-out;
}

.animate-zoomIn {
    animation: zoomIn 0.2s cubic-bezier(.16,.72,.45,1);
}

/*toast message*/
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

.animate-fadeInOut {
    animation: fadeInOut 2s ease-in-out forwards;
}

/*confirm dialog*/
@keyframes fadeInSlow {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

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

.animate-fadeInSlow {
    animation: fadeInSlow 0.25s ease-out;
}

.animate-zoomIn {
    animation: zoomIn 0.2s cubic-bezier(.16,.72,.45,1);
}

/*lang dropdown*/
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

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


/*total bar*/

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.animate-fadein {
    animation: fadein 0.4s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

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

.animate-slideUp {
    animation: slideUp 0.4s ease forwards;
}

/*dashboard table*/

/* Fade-in animation for table rows */
@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.table-row-animate {
    animation: rowFadeIn 0.45s ease-out forwards;
}

/* Smooth hover highlight */
.table-row-hover:hover {
    background-color: rgba(59,130,246,0.08) !important; /* blue-500/8 */
    transition: background-color 0.25s ease;
}


html, body {
    height: 100%;
    overflow: hidden; /*  prevent browser page scroll bar */
}


/* ===== Custom Scrollbar (Chrome, Edge, Safari) ===== */

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

/* Scrollbar track */
::-webkit-scrollbar-track {
    background: transparent;
}

/* Scrollbar handle */
::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #60A5FA, #3B82F6);
    border-radius: 10px;
}

    /* On hover */
    ::-webkit-scrollbar-thumb:hover {
        background: #2563EB; /* darker sky blue */
    }

/* Ultra-thin horizontal scrollbar */
.table-scroll::-webkit-scrollbar {
    height: 4px; /* thickness */
}

.table-scroll::-webkit-scrollbar-thumb {
    background: #3b82f6; /* blue color */
    border-radius: 10px;
}

.table-scroll::-webkit-scrollbar-track {
    background: transparent;
}


/*logout menu*/
@keyframes slideFadeIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slideFadeIn {
    animation: slideFadeIn 0.35s ease-out forwards;
}



html {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}


@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-VariableFont.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

body {
    line-height: 1.55;
}

input, button, select, textarea {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
}

.ai-buy {
    background-color: #dcfce7; /* green-100 */
    color: #15803d; /* green-700 */
    font-weight: 600;
}

.ai-discount {
    background-color: #fee2e2; /* red-100 */
    color: #b91c1c; /* red-700 */
    font-weight: 600;
}
/*customer value*/
.ai-good {
    background-color: rgba(168, 85, 247, 0.15); /* purple */
    color: #7c3aed;
    font-weight: 600;
}

.ai-normal {
    background-color: rgba(34, 197, 94, 0.15); /* green */
    color: #15803d;
}

.ai-potential {
    background-color: rgba(59, 130, 246, 0.15); /* blue */
    color: #1d4ed8;
}

.ai-risk {
    background-color: rgba(239, 68, 68, 0.15); /* red */
    color: #b91c1c;
    font-weight: 600;
}

/* ≥ 50 : Purple (Good customer) */
.ai-score-purple {
    color: #2e1065; /* very deep purple text */
    background: linear-gradient( 135deg, rgba(139, 92, 246, 0.30), rgba(88, 28, 135, 0.85) );
    font-weight: 600;
}


/* 30–49 : Blue (Potential customer) */
.ai-score-blue {
    color: #1e3a8a; /* deep blue text */
    background: linear-gradient( 135deg, rgba(96, 165, 250, 0.25), rgba(37, 99, 235, 0.50) );
}

.ai-score-red {
    background: radial-gradient(circle at top left, #fecaca, #ef4444);
    color: #7f1d1d;
}

.ai-score-orange {
    color: #7c2d12; /* deep orange text */
    background: linear-gradient( 135deg, rgba(253, 186, 116, 0.55), /* orange-300 */
    rgba(249, 115, 22, 0.70) /* orange-500 */
    );
    font-weight: 600;
}


.ai-score-yellow {
    color: #78350f; /* deep amber text */
    background: linear-gradient( 135deg, rgba(253, 224, 71, 0.45), /* yellow-300 */
    rgba(245, 158, 11, 0.60) /* amber-500 */
    );
}


/* 0–9 : Black (Low impact) */
.ai-score-black {
    color: #111827; /* near-black */
    background-color: rgba(17, 24, 39, 0.04);
}




/*datagrid*/
.row-selected {
    background-color: rgba(124, 58, 237, 0.10) !important; /* light purple */
}

    .row-selected td {
        background-color: rgba(124, 58, 237, 0.10) !important;
    }

/* =========================
   AI Score – Ball Style
   ========================= */

.ai-score-critical,
.ai-score-high,
.ai-score-medium,
.ai-score-low,
.ai-score-green,
.ai-score-yellow,
.ai-score-orange,
.ai-score-red,
.ai-score-blue, .ai-score-purple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    border-radius: 1000px; /* perfect circle */
    font-weight: 500;
    font-size: 0.80rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    /* Hover feedback */
    .ai-score-critical:hover,
    .ai-score-high:hover,
    .ai-score-medium:hover,
    .ai-score-low:hover,
    .ai-score-green:hover,
    .ai-score-yellow:hover,
    .ai-score-orange:hover,
    .ai-score-red:hover,
    .ai-score-blue :hover,
    .ai-score-purple :hover {
        transform: scale(1.1);
        box-shadow: 0 6px 14px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.7);
    }


/* Severity colors */
.ai-score-critical {
    background: radial-gradient(circle at top left, #fecaca, #ef4444);
    color: #7f1d1d;
}

.ai-score-high {
    background: radial-gradient(circle at top left, #fed7aa, #fb923c);
    color: #7c2d12;
}

.ai-score-medium {
    background: radial-gradient(circle at top left, #fef3c7, #facc15);
    color: #713f12;
}

.ai-score-low {
    background: radial-gradient(circle at top left, #bae6fd, #38bdf8);
    color: #075985;
}

.ai-score-normal {
    background: white !important; /* 🔴 remove gradient */
    background-image: none !important; /* 🔴 ensure no radial-gradient */
    box-shadow: none !important; /* 🔴 remove glow */

    color: #15803d; /* green-700 */
    font-weight: 600;
}


/* 10–29 : Green (Normal customer) */
.ai-score-green {
    color: #14532d; /* deep green text */
    background: linear-gradient( 135deg, rgba(34, 197, 94, 0.20), rgba(21, 128, 61, 0.45) );
}



.ai-score-cell {
    vertical-align: middle;
    padding: 4px 8px; /* controls spacing inside cell */
}

/*img in datagrid*/

.img-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}


.grid-thumb {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
}




.img-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: overlayFadeIn 180ms ease-out forwards;
}

    .img-overlay.closing {
        animation: overlayFadeOut 180ms ease-in forwards;
    }


.img-preview {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    cursor: default;
    animation: imageZoomIn 220ms ease-out forwards;
}

    .img-preview.closing {
        animation: imageZoomOut 200ms ease-in forwards;
    }

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

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

@keyframes imageZoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.92);
    }
}

.img-wrapper {
    position: relative;
    display: inline-block;
}


.img-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    transition: transform 0.15s ease, background 0.15s ease;
    z-index: 2; /* 👈 ensure it stays above image */
}




    .img-close-btn:hover {
        background: rgba(0, 0, 0, 0.85);
        transform: scale(1.1);
    }






.cloudwi-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

    .cloudwi-close-btn:hover {
        background: rgba(0, 0, 0, 0.85);
        transform: scale(1.1);
    }

    .cloudwi-close-btn:focus-visible {
        outline: 2px solid rgba(255,255,255,0.8);
        outline-offset: 2px;
    }

.cloudwi-close-icon {
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}


/*show tip on grid cell*/
.ai-cell-multiline {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* show 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: help;
    /* font-size: 1.01rem;  between text-sm and text-base */
}

    .ai-tooltip-wrapper

{
    position: relative;
    cursor: help;
}

.ai-tooltip {
    position: absolute;
    z-index: 9999;
    max-width: 420px;
    background: #111827; /* dark gray */
    color: #fff;
    font-size: 1.05rem; /* 👈 BIGGER FONT */
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease;
}

.ai-tooltip-wrapper:hover .ai-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

input[type="date"]:focus,
input[type="date"]:focus-visible {
    outline: none;
    box-shadow: none;
}
