* {
    font-family: 'Inter', sans-serif;
}

body {
    transition: all 0.3s ease;
}

.theme-transition {
    transition: background-color 0.5s ease, color 0.5s ease;
}

.bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='20' height='20' fill='%23ffffff'/%3E%3Cpath d='M 20 0 L 0 0 0 20' fill='none' stroke='%23e5e7eb' stroke-width='0.5'/%3E%3C/svg%3E");
}

.dark .bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='20' height='20' fill='%23111827'/%3E%3Cpath d='M 20 0 L 0 0 0 20' fill='none' stroke='%23374151' stroke-width='0.5'/%3E%3C/svg%3E") !important;
}

.hero-gradient {
    background: linear-gradient(135deg, rgba(249, 246, 241, 0.8) 0%, rgba(35, 67, 107, 0.05) 100%);
}

.dark .hero-gradient {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.dark-mode-toggle {
    position: relative;
    width: 50px;
    height: 25px;
    background: #ddd;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #23436B;
}

.dark-mode-toggle.dark {
    background: #23436B;
    border-color: #EAEAEA;
}

.toggle-circle {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 19px;
    height: 19px;
    background: #23436B;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: white;
}

.dark-mode-toggle.dark .toggle-circle {
    left: 27px;
    background: #EAEAEA;
    color: #23436B;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #F9F6F1;
}

.dark .loading-screen {
    background: #191E29;
}

.loading-dots {
    display: flex;
    gap: 6px;
    margin-top: 1.5rem;
}

.loading-dot {
    width: 10px;
    height: 10px;
    background-color: #FFCB66;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { 
    animation-delay: -0.32s; 
}

.loading-dot:nth-child(2) { 
    animation-delay: -0.16s; 
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    scale: 1.02;
}

.feature-card {
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.quote-box {
    position: relative;
    background: linear-gradient(135deg, rgba(35, 67, 107, 0.05) 0%, rgba(255, 203, 102, 0.1) 100%);
    border-left: 4px solid #23436B;
    border-radius: 0 12px 12px 0;
}

.dark .quote-box {
    background: linear-gradient(135deg, rgba(35, 67, 107, 0.2) 0%, rgba(255, 203, 102, 0.1) 100%);
    border-left: 4px solid #FFCB66;
}

.quote-box::before {
    content: '"';
    position: absolute;
    top: -5px;
    left: 15px;
    font-size: 3rem;
    color: #23436B;
    opacity: 0.3;
}

.dark .quote-box::before {
    color: #FFCB66;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-container {
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    min-width: 100%;
    margin-right: 1.5rem;
}

.dansist-chat-bg {
    background-image: radial-gradient(circle at 1px 1px, rgba(35, 67, 107, 0.08) 1px, transparent 0);
    background-size: 20px 20px;
    scroll-behavior: smooth;
}

.dark .dansist-chat-bg {
    background-image: radial-gradient(circle at 1px 1px, rgba(75, 49, 36, 0.3) 1px, transparent 0);
}

.dansist-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.dansist-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.dansist-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(35, 67, 107, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.dansist-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(35, 67, 107, 0.5);
}

.dark .dansist-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 203, 102, 0.3);
}

.dark .dansist-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 203, 102, 0.5);
}

.chat-fade-in {
    animation: chatFadeIn 0.3s ease-out;
}

.scroll-indicator {
    position: absolute;
    bottom: 80px;
    right: 10px;
    background: rgba(35, 67, 107, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scroll-indicator.show {
    opacity: 1;
}

#ai-prompt {
    transition: height 0.1s ease;
}

.ai-modal-slide-up {
    animation: slideUpFromBottom 0.3s ease-out forwards;
}

.spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#categoryChart, #growthChart, #salesChart, #regionChart {
    display: block !important;
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
}

canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
}

.relative.h-32,
.relative.h-48 {
    height: 200px !important;
    min-height: 200px !important;
    width: 100% !important;
    position: relative !important;
}

.bg-white.dark\\:bg-gray-800.rounded-xl.p-4,
.bg-white.dark\\:bg-gray-800.rounded-xl.p-6 {
    min-height: 250px !important;
}

.circular-progress {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(#FFCB66 0deg 360deg, transparent 360deg);
    position: relative;
}

.circular-progress::before {
    content: '';
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: inherit;
    position: absolute;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 203, 102, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #23436B 0%, #FFCB66 100%);
    border-radius: 4px;
    transform-origin: left;
    animation: fillProgress 2s ease-out forwards;
}

.stat-card {
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .stat-card {
    background: linear-gradient(135deg, rgba(35, 67, 107, 0.2) 0%, rgba(255, 203, 102, 0.1) 100%);
    border: 1px solid rgba(255, 203, 102, 0.2);
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.mini-chart {
    width: 100%;
    height: 30px;
    position: relative;
    margin-top: 8px;
}

.chart-bar {
    position: absolute;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to top, #23436B, #FFCB66);
    border-radius: 3px 3px 0 0;
    animation: chartGrow 1.5s ease-out forwards;
    transform-origin: bottom;
}

.chart-bar:nth-child(1) { left: 10%; height: 60%; animation-delay: 0.1s; }
.chart-bar:nth-child(2) { left: 25%; height: 80%; animation-delay: 0.2s; }
.chart-bar:nth-child(3) { left: 40%; height: 45%; animation-delay: 0.3s; }
.chart-bar:nth-child(4) { left: 55%; height: 90%; animation-delay: 0.4s; }
.chart-bar:nth-child(5) { left: 70%; height: 70%; animation-delay: 0.5s; }
.chart-bar:nth-child(6) { left: 85%; height: 55%; animation-delay: 0.6s; }

.count-animation {
    animation: countUp 0.8s ease-out forwards;
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.float-delay-1 {
    animation: float 4s ease-in-out infinite 0.5s;
}

.float-delay-2 {
    animation: float 5s ease-in-out infinite 1s;
}

.float-delay-3 {
    animation: float 6s ease-in-out infinite 1.5s;
}

.float-delay-4 {
    animation: float 4.5s ease-in-out infinite 2s;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: #23436B;
    border-radius: 4px;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(35, 67, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(35, 67, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(35, 67, 107, 0); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@keyframes fillProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes chartGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes chatFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (min-width: 1024px) {
    .dark-mode-toggle {
        width: 60px;
        height: 30px;
    }
    
    .toggle-circle {
        top: 2px;
        left: 2px;
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    
    .dark-mode-toggle.dark .toggle-circle {
        left: 32px;
    }
    
    .loading-dots {
        gap: 8px;
        margin-top: 2rem;
    }
    
    .loading-dot {
        width: 12px;
        height: 12px;
    }
    
    .quote-box::before {
        top: -10px;
        left: 20px;
        font-size: 4rem;
    }
    
    .circular-progress {
        width: 80px;
        height: 80px;
    }
    
    .circular-progress::before {
        width: 60px;
        height: 60px;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .stat-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
    
    .mini-chart {
        height: 40px;
        margin-top: 12px;
    }
    
    .chart-bar {
        width: 8px;
        border-radius: 4px 4px 0 0;
    }
    
    .feature-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }
    
    .modal {
        padding: 0;
    }
    
    ::-webkit-scrollbar {
        width: 8px;
    }
}

@media (min-width: 768px) {
    .carousel-slide {
        min-width: 80%;
        margin-right: 2rem;
    }
}

@media (max-width: 1367px) {
    .max-w-6xl {
        max-width: 90%;
    }
    
    #ai-chat-content {
        width: 550px !important;
        height: 500px !important;
    }
    
    .relative.h-32,
    .relative.h-48 {
        min-height: 180px !important;
        height: 180px !important;
    }
    
    #categoryChart, #growthChart, #salesChart, #regionChart {
        height: 180px !important;
        width: 100% !important;
        display: block !important;
    }
    
    canvas {
        min-height: 160px !important;
        height: 160px !important;
        width: 100% !important;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    p {
        font-size: 0.9rem !important;
    }
    
    .btn, button {
        padding: 0.5rem 0.5rem !important;
        font-size: 0.85rem !important;
    }
    
    .product-card img {
        height: 160px !important;
    }
    
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-16 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .glass-card {
        padding: 0.75rem !important;
    }
    
    .min-h-screen {
        min-height: 100vh !important;
    }
    
    .fixed.top-4 {
        top: 0.5rem !important;
    }
    
    .pt-24 {
        padding-top: 5rem !important;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    #ai-chat-content {
        width: 450px !important;
        height: 500px !important;
    }
    
    .relative.h-32,
    .relative.h-48 {
        min-height: 160px !important;
        height: 160px !important;
    }
    
    #categoryChart, #growthChart, #salesChart, #regionChart {
        height: 160px !important;
        width: 100% !important;
        display: block !important;
    }
    
    canvas {
        min-height: 140px !important;
        height: 140px !important;
        width: 100% !important;
    }
    
    .grid.grid-cols-2.lg\\:grid-cols-4 > div {
        min-height: 200px !important;
    }
}

@media (max-width: 1024px) {
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
    }
    
    p {
        font-size: 0.875rem !important;
    }
    
    #ai-chat-content {
        width: 350px !important;
        height: 500px !important;
    }
}

@media (max-width: 768px) {
    .relative.h-32,
    .relative.h-48 {
        height: 160px !important;
        min-height: 160px !important;
    }
    
    #categoryChart, #growthChart, #salesChart, #regionChart {
        height: 140px !important;
        min-height: 140px !important;
    }
    
    canvas {
        max-height: 140px !important;
        height: 140px !important;
        min-height: 140px !important;
        width: 100% !important;
    }
    
    .bg-white.dark\\:bg-gray-800.rounded-xl.p-4,
    .bg-white.dark\\:bg-gray-800.rounded-xl.p-6 {
        min-height: 200px !important;
    }
    
    .grid.grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .bg-white.dark\\:bg-gray-800.rounded-xl {
        padding: 0.75rem !important;
    }
    
    .pt-24 {
        padding-top: 8rem !important;
    }
    
    .fixed.bottom-24 {
        bottom: 5rem !important;
    }
    
    .fixed.bottom-32 {
        bottom: 6rem !important;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1rem !important;
    }
    
    p {
        font-size: 0.8rem !important;
    }
    
    .product-card img {
        height: 140px !important;
    }
    
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .relative.h-32,
    .relative.h-48 {
        height: 140px !important;
        min-height: 140px !important;
    }
    
    #categoryChart, #growthChart, #salesChart, #regionChart {
        height: 120px !important;
        min-height: 120px !important;
    }
    
    canvas {
        max-height: 120px !important;
        height: 120px !important;
        min-height: 120px !important;
    }
    
    .bg-white.dark\\:bg-gray-800.rounded-xl.p-4,
    .bg-white.dark\\:bg-gray-800.rounded-xl.p-6 {
        min-height: 180px !important;
    }
    
    .carousel-slide {
        min-width: 90%;
        margin-right: 1rem;
    }
    
    #ai-chat-content {
        width: 350px !important;
        height: 500px !important;
    }
    
    .dansist-scrollbar::-webkit-scrollbar {
        width: 4px;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .loading-dot {
        width: 11px;
        height: 11px;
    }
}

@media (-webkit-min-device-pixel-ratio: 2) and (min-width: 1024px), (min-resolution: 192dpi) and (min-width: 1024px) {
    .loading-dot {
        width: 13px;
        height: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .float-animation,
    .float-delay-1,
    .float-delay-2,
    .float-delay-3,
    .float-delay-4 {
        animation: none !important;
    }
}

@media print {
    .fixed,
    #ai-chat-modal,
    #ai-open-button,
    #back-to-top,
    #loading-screen {
        display: none !important;
    }
    
    .py-20,
    .py-16,
    .py-12 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}