/* DelSmart Premium Unified Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Core HSL Tokens - Easy to adjust saturation/lightness */
    --h-primary: 224;
    --s-primary: 76%;
    --l-primary: 48%;

    /* Brand Colors (HSL) */
    --primary: hsl(var(--h-primary), var(--s-primary), var(--l-primary));
    --primary-light: hsl(var(--h-primary), var(--s-primary), 96%);
    --primary-dark: hsl(var(--h-primary), var(--s-primary), 40%);
    --accent: hsl(262, 80%, 50%);
    /* Vibrant Purple */

    /* Semantic Colors */
    --success: hsl(142, 70%, 45%);
    --danger: hsl(346, 84%, 61%);
    --warning: hsl(38, 92%, 50%);
    --info: hsl(199, 89%, 48%);

    /* Neutrals */
    --bg-body: hsl(220, 33%, 98%);
    --text-main: hsl(222, 47%, 11%);
    --text-muted: hsl(215, 16%, 47%);
    --border-subtle: rgba(226, 232, 240, 0.6);

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Layout Tokens */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --navbar-h: 70px;
}

body {
    background-color: var(--bg-body) !important;
    background-image:
        radial-gradient(at 0% 0%, hsla(var(--h-primary), var(--s-primary), var(--l-primary), 0.05) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(262, 80%, 50%, 0.05) 0, transparent 50%),
        radial-gradient(at 50% 100%, hsla(var(--h-primary), var(--s-primary), var(--l-primary), 0.03) 0, transparent 50%);
    background-attachment: fixed;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Global Container Improvements */
.container-page {
    padding: 1rem 1.5rem;
    width: 100%;
    margin: 0;
}

/* Premium Card Styles */
.card,
.card-box,
.glass-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--glass-shadow) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card:hover,
.glass-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08) !important;
    border-color: hsla(var(--h-primary), var(--s-primary), var(--l-primary), 0.3) !important;
}

.card-header {
    background: hsla(var(--h-primary), var(--s-primary), var(--l-primary), 0.03) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    padding: 0.75rem 1.25rem !important;
}

.card-body {
    padding: 1rem 1.25rem !important;
}

.card-title,
.header-title {
    color: var(--primary) !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
}

/* Forms & Inputs */
.form-control,
.form-select,
.select2-container--default .select2-selection--single {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-subtle) !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    background-color: #ffffff !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px hsla(var(--h-primary), var(--s-primary), var(--l-primary), 0.1) !important;
}

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 700;
    padding: 0.6rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.8rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px hsla(var(--h-primary), var(--s-primary), var(--l-primary), 0.3) !important;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px hsla(var(--h-primary), var(--s-primary), var(--l-primary), 0.4) !important;
    filter: brightness(110%);
}

.btn-outline-primary {
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
}

.btn-outline-primary:hover {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
}

.bg-soft-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.bg-soft-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.bg-soft-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.bg-soft-info {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.bg-soft-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.bg-soft-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    color: var(--text-primary);
    border-top: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table td {
    vertical-align: middle;
    color: var(--text-secondary);
}

/* Navbar Customizations */
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: var(--navbar-height);
}

/* Left Sidebar */
.left-side-menu {
    background-color: #ffffff !important;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.02);
}

#sidebar-menu>ul>li>a {
    border-radius: 12px;
    margin: 5px 15px;
    padding: 12px 15px;
    color: var(--text-secondary) !important;
    font-weight: 500;
}

#sidebar-menu>ul>li>a:hover {
    background-color: rgba(37, 99, 235, 0.05);
    color: var(--accent-color) !important;
}

#sidebar-menu>ul>li>a.active {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Utility Classes */
.rounded-xl {
    border-radius: 1.25rem !important;
}

.shadow-premium {
    box-shadow: var(--shadow-lg) !important;
}

/* Landing Page Specific Utilities */
.landing-hero {
    background: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(37, 99, 235, 0.05) 0, transparent 50%),
        #ffffff;
    padding: 180px 0 100px 0;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    top: -300px;
    right: -200px;
    z-index: 0;
}

.feature-glass-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(37, 99, 235, 0.1) !important;
    padding: 2.5rem !important;
    border-radius: 24px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-glass-card:hover {
    transform: translateY(-10px);
    background: #ffffff !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05) !important;
    border-color: var(--accent-color) !important;
}

.icon-box-lg {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

/* Premium Glass Icons */
/* Premium Glass Icons - Gradient Circle Style */
.icon-box-glass {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Circle */
    font-size: 24px;
    color: #ffffff;
    /* White Text */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.icon-box-glass:hover {
    transform: translateY(-5px) scale(1.05);
}

.icon-box-glass.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-box-glass.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-box-glass.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-box-glass.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-box-glass.info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-box-glass.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-label {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent-color);
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.testimonial-card {
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-sm);
}

/* Navbar Custom Landing */
.navbar-landing {
    transition: all 0.3s ease;
    padding: 1.25rem 0;
}

.navbar-landing.sticky {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
}

.btn-neon {
    background: var(--accent-color);
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

.btn-neon:hover {
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
    transform: scale(1.02);
}

/* Responsive Fixes */
/* Dashboard Card Layout Refinement - Vertical Stack */
.mini-stats-wid .card-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 1.5rem !important;
    min-height: 160px;
}

.mini-stats-wid .icon-box-glass {
    order: -1;
    margin-bottom: 1rem !important;
}

.mini-stats-wid h4,
.mini-stats-wid h5 {
    font-weight: 800 !important;
    margin-bottom: 0.25rem !important;
}

.mini-stats-wid p {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
}

.footer {
    background: hsla(0, 0%, 100%, 0.6) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-subtle);
    padding: 20px 0 !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

/* AI Assistant Premium Chat Interface */
.ai-assistant-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ai-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(67, 97, 238, 0.6);
}

.ai-chat-window {
    width: 380px !important;
    height: 550px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.ai-chat-window.show {
    display: flex !important;
    transform: translateY(0);
    opacity: 1;
}

.ai-chat-header {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    padding: 15px 20px;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.ai-chat-header h5 {
    color: white !important;
    margin: 0 !important;
    font-size: 1.1rem;
    font-weight: 700;
}

.ai-chat-header .mdi {
    font-size: 24px;
    margin-right: 8px;
}

.ai-chat-body {
    flex: 1 !important;
    padding: 20px !important;
    overflow-y: auto !important;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8faff !important;
    max-height: calc(550px - 130px);
    /* Specific height constraint */
}

/* Scrollbar Style */
.ai-chat-body::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    animation: message-in 0.3s ease-out forwards;
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-ai {
    align-self: flex-start;
    background: white !important;
    color: #1e293b !important;
    border-bottom-left-radius: 4px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4361ee, #3a0ca3) !important;
    color: white !important;
    border-bottom-right-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.ai-chat-footer {
    padding: 15px;
    background: white !important;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 70px;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 12px 15px !important;
    font-size: 0.9rem;
    outline: none;
    background: white !important;
    color: #1e293b !important;
    transition: all 0.2s;
}

.ai-chat-input:focus {
    border-color: #4361ee !important;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.ai-chat-send {
    width: 44px !important;
    height: 44px !important;
    background: linear-gradient(135deg, #4361ee, #3a0ca3) !important;
    border: none;
    border-radius: 12px;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-chat-send:active {
    transform: scale(0.9);
}

.typing-indicator {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 15px;
    display: none;
    align-self: flex-start;
    gap: 4px;
    margin-bottom: 15px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }
}

/* Dark Mode Overrides */
[data-layout-color='dark'] .ai-chat-window {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-layout-color='dark'] .ai-chat-body {
    background: rgba(15, 23, 42, 0.5);
}

[data-layout-color='dark'] .message-ai {
    background: #334155;
    color: white;
    border-color: rgba(255, 255, 255, 0.05);
}

[data-layout-color='dark'] .ai-chat-footer {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.05);
}

[data-layout-color='dark'] .ai-chat-input {
    background: #0f172a;
    border-color: #334155;
    color: white;
}