/* styles.css */
body {
    background-color: #F7F5F2;
    color: #2A3B00;
}

/* Scrollbar Utils */
.hide-scroll::-webkit-scrollbar {
    display: none;
}

.hide-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

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

.custom-scroll::-webkit-scrollbar-thumb {
    background: #E5E5E5;
    border-radius: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #CBBFA3;
}

/* Sidebar Logic */
.sidebar-item {
    position: relative;
    transition: color 0.3s ease;
    z-index: 1;
    overflow: hidden;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #FAFAF8;
    z-index: -1;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item:hover::before {
    width: 100%;
}

.sidebar-item.active {
    color: #435E01;
    font-weight: 700;
    background-color: #FAFAF8;
}

.sidebar-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: #435E01;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Bars & Markers */
.progress-bar-bg {
    background-color: #E5E5E5;
    border-radius: 999px;
    overflow: hidden;
    height: 10px;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.breakeven-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background-color: #2A3B00;
    z-index: 10;
}

/* Premium Card Styles */
.card-top-1 {
    border: 2px solid rgba(212, 175, 55, 0.3) !important;
    background: linear-gradient(145deg, #fffcf5 0%, #ffffff 100%) !important;
    position: relative;
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(212, 175, 55, 0.15) !important;
}

.card-top-1::before {
    content: '👑';
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 24px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

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

    50% {
        transform: translateY(-5px);
    }
}

.consultant-box {
    background: linear-gradient(135deg, #FDF9F1 0%, #F0E3C2 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-left: 4px solid #D4AF37;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton-box {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #E5E5E5 4%, #F3F3F3 25%, #E5E5E5 36%);
    background-size: 1000px 100%;
    border-radius: 4px;
}

/* Thêm vào để CSS ẩn hiện lúc đang tải */
.is-loading .hide-on-load {
    opacity: 0;
    pointer-events: none;
}

.show-on-load {
    display: none;
}

.is-loading .show-on-load {
    display: block;
}

.is-loading .kpi-card-content {
    opacity: 0;
    position: absolute;
}

.is-loading .skeleton-kpi {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* AI Panel */
#aiCommandPanel {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100vh;      /* Fallback */
    height: 100dvh;     /* Dynamic viewport height cho mobile */
}

/* Đảm bảo ô input luôn nằm trên cùng bàn phím iOS */
@supports (-webkit-touch-callout: none) {
    #aiCommandPanel {
        height: -webkit-fill-available;
    }
}

.ai-panel-open {
    transform: translateX(0) !important;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.15);
}

.ai-backdrop {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-backdrop.active {
    display: block;
    opacity: 1;
}

@keyframes typing {

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

    50% {
        transform: translateY(-4px);
    }
}

.typing-dot {
    width: 4px;
    height: 4px;
    background-color: #435E01;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
}