@layer base {
    :root {
        /* Material Design 3 inspired color tokens */
        --primary: #006c4a;
        --primary-dim: #005f41;
        --primary-container: #85f8c4;
        --on-primary-container: #005e40;
        --primary-fixed: #85f8c4;
        --primary-fixed-dim: #76eab6;
        --on-primary: #e0ffec;

        --secondary: #526074;
        --secondary-dim: #465468;
        --secondary-container: #d5e3fc;
        --on-secondary: #f8f8ff;

        --surface: #f7f9fb;
        --surface-dim: #cfdce3;
        --surface-bright: #f7f9fb;
        --surface-container-lowest: #ffffff;
        --surface-container-low: #f0f4f7;
        --surface-container: #e8eff3;
        --surface-container-high: #e1e9ee;
        --surface-container-highest: #d9e4ea;

        --on-surface: #2a3439;
        --on-surface-variant: #566166;
        --outline: #717c82;
        --outline-variant: #a9b4b9;

        --error: #9f403d;
        --error-container: #fe8983;

        --radius-standard: 20px;
        --radius-inner: 12px;
        --transition-standard: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        --shadow-premium: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
        --shadow-premium-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

        /* Chat/Inbox Variables */
        --color-primary: #01ac60;
        --color-bg-light: #f7f5f3;
        --color-bg-chat: #efeae2;
        --color-bg-message-out: #d9fdd3;
        --color-bg-message-in: #fff;
        --color-text-primary: #111b21;
        --color-text-secondary: #54656f;
        --color-text-tertiary: #667781;
        --color-border: #ccc;
    }

    .ring-1 {
        --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) #ffffff;
        --tw-ring-shadow: va;
        --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    }

    /* Support for Material Symbols when still used */
    .material-symbols-outlined {
        font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
        display: inline-block;
        line-height: 1;
        text-transform: none;
        letter-spacing: normal;
        word-wrap: normal;
        white-space: nowrap;
        direction: ltr;
    }

    .border-b-emerald-500 {
        border-bottom: 4px solid #10b981 !important;
    }

    .border-b-amber-500 {
        border-bottom: 4px solid #f59e0b !important;
    }

    .border-b-blue-500 {
        border-bottom: 4px solid #3b82f6 !important;
    }

    .border-b-red-500 {
        border-bottom: 4px solid #ef4444 !important;
    }



    .dark {
        --primary: #7ff3be;
        --primary-dim: #76eab6;
        --surface: #0b0f10;
        --on-surface: #e1e9ee;
        --on-surface-variant: #9a9d9f;
        --surface-container-lowest: #0b1113;
        --surface-container-low: #1a1c1e;
        --surface-container: #1e2022;
        --surface-container-high: #282a2d;
        --surface-container-highest: #333538;
    }

}

@layer components {

    /* Unified Card Component */
    .premium-card {
        background-color: var(--surface-container-lowest);
        border-radius: 10px;
        border: 1px dashed rgba(104, 102, 102, 0.378);
        padding: 1.5rem;
        transition: var(--transition-standard);
        box-shadow: var(--shadow-premium);
        position: relative;
        overflow: hidden;
    }

    .premium-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-premium-hover);
        border-color: rgba(0, 108, 74, 0.2);
    }

    .premium-card.no-hover:hover {
        transform: none !important;
        box-shadow: var(--shadow-premium) !important;
        border-color: rgba(169, 180, 185, 0.15) !important;
    }

    .premium-card.hover-border {
        border: 1px solid rgba(28, 28, 28, 0.15) !important;
        transition: border-color var(--transition-standard), box-shadow var(--transition-standard) !important;
    }

    .premium-card.hover-border:hover {
        transform: none !important;
        box-shadow: var(--shadow-premium) !important;
        border-color: var(--primary) !important;
    }

    .premium-card.border-b-primary {
        border-bottom: 4px solid var(--primary) !important;
    }

    .premium-card.border-b-amber {
        border-bottom: 4px solid #f59e0b !important;
    }

    /* Glassmorphism Variation */
    .glass-card {
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: var(--radius-standard);
        box-shadow: var(--shadow-premium);
    }

    .dark .glass-card {
        background: rgba(11, 17, 19, 0.7);
        border-color: rgba(255, 255, 255, 0.05);
    }

    /* Premium Typography */
    .font-label {
        font-family: 'Manrope', sans-serif !important;
    }

    .font-body {
        font-family: 'Inter', sans-serif !important;
    }

    .text-premium-xs {
        font-size: 0.75rem;
        line-height: 1rem;
        font-weight: 500;
        font-family: 'Manrope', sans-serif;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--on-surface-variant);
    }

    .text-premium-sm {
        font-size: 0.875rem;
        line-height: 1.25rem;
        font-weight: 500;
        float: left;
    }

    .text-premium-md {
        font-size: 1rem;
        line-height: 1.5rem;
        font-weight: 600;
    }

    .text-premium-lg {
        font-size: 1.25rem;
        line-height: 1.75rem;
        font-weight: 700;
        color: var(--on-surface);
    }

    .text-premium-xl {
        font-size: 1.5rem;
        line-height: 2rem;
        font-weight: 800;
        letter-spacing: -0.025em;
    }

    .text-premium-2xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
        font-weight: 900;
        letter-spacing: -0.05em;
    }

    /* Progress Bridge */
    .premium-progress-container {
        width: 100%;
        height: 8px;
        background-color: var(--surface-container-high);
        border-radius: 999px;
        overflow: hidden;
    }

    .premium-progress-bar {
        height: 100%;
        border-radius: 999px;
        background-color: var(--primary);
        transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Global Gradients */
    .bg-primary-gradient {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dim) 100%);
    }

    /* Animation Utilities */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translate3d(0, 20px, 0);
        }

        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    .animate-premium-fade-in-up {
        animation: fadeInUp 0.6s both cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes spin {
        from {
            transform: rotate(0deg);
        }

        to {
            transform: rotate(360deg);
        }
    }

    .animate-spin-slow {
        animation: spin 3s linear infinite;
    }

    /* ========================================
       INBOX PAGE STYLES (Migrated)
       ======================================== */
    .w-16 {
        width: 70px !important;
    }

    @media (min-width: 768px) {
        .w-350 {
            width: 380px;
        }
    }

    @media (max-width: 375px) {
        .w-350 {
            width: 100%;
        }
    }

    .guest-bg {
        background-color: #fff;
        cursor: pointer;
    }

    .guest-bg:hover {
        background-color: var(--color-bg-light);
    }

    .guest-unread {
        background-color: #e8f5e9;
        font-weight: 600;
        cursor: pointer;
    }

    .guest-unread:hover {
        background-color: #c8e6c9;
    }

    .unread-badge {
        background-color: var(--color-primary);
        color: white;
        border-radius: 50%;
        min-width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: bold;
        padding: 0 6px;
    }

    .pulse-animation {
        animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.7;
        }
    }

    .avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-bottom: 5px;
        background-color: var(--color-primary);
        display: flex;
        color: #fff;
        padding: 10px;
        margin-right: 10px;
        align-items: center;
        justify-content: center;
    }

    .search-input {
        width: 100%;
        padding: 10px;
        border-radius: 5px;
        border: 1px solid var(--color-border);
        background-color: #fff;
        color: #000;
        font-weight: 500;
    }

    .icon {
        justify-content: center !important;
        width: 50px;
        height: 50px;
        color: white;
        border-radius: 5px;
        background-color: #1e323e;
        display: grid;
        padding: 10px;
        align-items: center;
    }

    .icon img {
        width: 40px;
    }

    .icon p {
        font-size: 11px;
    }

    .icon:hover {
        cursor: pointer;
        background-color: #009966;
    }

    .chat-bg {
        background-color: var(--color-bg-chat);
        background-image: url('/storage/whatsapp-bg.png');
        background-repeat: repeat;
        background-size: contain;
    }

    .max-w-85 {
        max-width: 90%;
        margin: 5px;
    }

    .max-w-65 {
        max-width: 65%;
    }

    .leading-relaxed {
        font-size: 14px;
    }

    .bg-white {
        background-color: #fff;
    }

    .bg-f0f2f5 {
        background-color: #f0f2f5;
    }

    .bg-efeae2 {
        background-color: var(--color-bg-chat);
    }

    .bg-d9fdd3 {
        background-color: var(--color-bg-message-out);
    }

    .bg-e7fce3 {
        background-color: #e7fce3;
    }

    .bg-ffebee {
        background-color: #ffebee;
    }

    .bg-00a884 {
        background-color: #00a884;
    }

    .bg-fff5c4 {
        background-color: #fff5c4;
    }

    .bg-e1d9b7 {
        border-color: #e1d9b7;
    }

    .text-gray {
        color: #3b3c3c;
        font-weight: 700;
    }

    .text-black {
        color: #000;
    }

    .text-111b21 {
        color: var(--color-text-primary);
    }

    .text-54656f {
        color: var(--color-text-secondary);
    }

    .text-667781 {
        color: var(--color-text-tertiary);
    }

    .text-008069 {
        color: #008069;
    }

    .text-53bdeb {
        color: #53bdeb;
    }

    .text-c62828 {
        color: #c62828;
    }

    .text-10px {
        font-size: 13px;
    }

    .text-11px {
        font-size: 11px;
    }

    .bg-green-100 {
        background-color: var(--color-primary);
        color: #fff;
    }

    .bg-red-100 {
        background-color: #e46a6aff;
        color: #fff;
    }

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

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

    ::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #messages-container {
        transform: translate3d(0, 0, 0);
    }

    .input-container-safe {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
    }

    /* Hover scale for image cards */
    .hover01 figure img {
        transform: scale(1);
        transition: var(--transition-standard);
    }

    .hover01 figure:hover img {
        transform: scale(1.08);
    }

    /* Fixed Filament Tabs margin */
    .fi-tabs {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* ========================================
       COMPETITOR ANALYSIS STYLES (Migrated)
       ======================================== */
    .kpi-card {
        background: white;
        border-radius: 12px;
        padding: 24px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        gap: 16px;
        width: 100%;
    }

    .dark .kpi-card {
        background: #0f172a;
        border: 1px solid #1f2937;
    }

    .kpi-icon-container {
        padding: 12px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .kpi-label {
        font-size: 16px;
        color: #6b7280;
        font-weight: 600;
    }

    .kpi-value {
        font-size: 24px;
        font-weight: 800;
        color: #0f172a;
    }

    .dark .kpi-value {
        color: white;
    }

    .text-success {
        color: #10b981;
    }

    .text-danger {
        color: #ef4444;
    }

    .currency-toggle {
        font-weight: 700;
        display: flex;
        background: #10b981;
        padding: 4px 30px;
        color: white;
        border-radius: 17px;
        gap: 22px;
    }

    .currency-toggle:hover {
        background: #0a7f58;
        color: white;
        border: 1px solid #ddd;
    }



    .dark .currency-toggle {
        background: #1f2937;
    }

    .currency-btn {
        padding: 4px 12px;
        font-size: 12px;
        font-weight: 700;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .currency-btn.active {
        background: white;
        color: #4f46e5;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .dark .currency-btn.active {
        background: #374151;
        color: #818cf8;
    }

    .matrix-table th {
        padding: 16px;
        font-size: 14px;
        font-weight: 700;
        color: #0f172a;
        background: #f9fafb;
        border-bottom: 1px solid #e5e7eb;
    }

    .dark .matrix-table th {
        color: white;
        background: #1f2937;
        border-bottom: 1px solid #374151;
    }

    .matrix-table td {
        padding: 16px;
        border-bottom: 1px solid #f3f4f6;
    }

    .dark .matrix-table td {
        border-bottom: 1px solid #1f2937;
    }

    .bg-advantage {
        background-color: #f0fdf4;
    }

    .dark .bg-advantage {
        background-color: rgba(16, 185, 129, 0.05);
    }

    .bg-red {
        background-color: #fef2f2;
    }

    .dark .bg-red {
        background-color: rgba(239, 68, 68, 0.05);
    }

    .ai-suggestion-card {
        background: white;
        border-radius: 12px;
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 16px;
        border: 1px solid #f3f4f6;
        border-left: 4px solid #10b981 !important;
    }

    .dark .ai-suggestion-card {
        background: #0f172a;
        border: 1px solid #1f2937;
        border-left: 4px solid #10b981 !important;
    }

    .min-w-100 {
        min-width: 100px;
    }

    .min-h-100 {
        min-height: 100px;
        height: 100px;
    }

    .min-h-140 {
        min-height: 140px;
        height: 140px;
    }

    .min-h-80 {
        min-height: 80px;
        height: 80px;
    }


    .text-8px {
        font-size: 8px;
    }

    .border-blue-400 {
        border-color: #4f46e5;
        background-color: #4f46e5;
    }

    .border-orange-400 {
        border-color: #f97316;
        background-color: #f97316;
    }

    .border-green-400 {
        border-color: #10b981;
        background-color: #10b981;
    }

    .border-red-400 {
        border-color: #ef4444;
        background-color: #ef4444;
    }

    .bg-rose-500 {
        background-color: #f43f5e;
        border-color: #f43f5e;
    }

    .gap-1\.5 {
        gap: 5px;
    }

    /* escaped dot for Tailwind like classes if any */
    .w-2\.h-2 {
        width: 10px;
        height: 10px;
    }

    .pl-15 {
        padding-left: 25px;
    }

    .mb-8 {
        margin-bottom: 10px;
    }

    /* ========================================
       LOGIN PAGE STYLES (Migrated)
       ======================================== */
    .fi-simple-header {
        display: none;
    }

    .dark\:text-white:is(.dark *) {
        color: rgb(0 0 0 / var(--tw-text-opacity, 1));
    }

    .sm\:px-12,
    .py-12 {
        padding: 0 !important;
    }

    /* Wrap in custom login container class to not break dashboard */
    .fi-simple-layout {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        background: #f5f5f5;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fi-simple-layout .container,
    .fi-simple-layout .container-login {
        display: flex;
        width: 100%;
        background: #fff;
        border-radius: 5px;
        overflow: hidden;
        box-shadow: 0 10px 40px #00000014;
        min-height: 500px;
    }

    .left-panel {
        flex: 0 0 40%;
        background: linear-gradient(135deg, #096 0%, #007a52 100%);
        padding: 30px;
        color: #fff;
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }

    .left-panel::before {
        content: '';
        position: absolute;
        width: 500px;
        height: 500px;
        background: #ffffff0d;
        border-radius: 50%;
        bottom: -250px;
        left: -150px;
    }

    .logo {
        width: 200px;
        margin-bottom: 50px;
        position: relative;
        z-index: 1;
    }

    .slogan {
        font-size: 25px;
        font-weight: 700;
        line-height: 1.2;
        margin-bottom: 20px;
        position: relative;
        z-index: 1;
    }

    .description {
        font-size: 17px;
        line-height: 1.7;
        opacity: .95;
        position: relative;
        z-index: 1;
        max-width: 450px;
    }

    .right-panel {
        flex: 0 0 60%;
        padding: 30px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: #fff;
    }

    .login-header {
        text-align: center;
        margin-bottom: 45px;
    }

    .login-header h1 {
        font-size: 36px;
        font-weight: 700;
        color: #0f172a;
        margin-bottom: 12px;
    }

    .secure-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #d1fae5;
        color: #096;
        padding: 10px 18px;
        border-radius: 25px;
        font-size: 10px;
        font-weight: 600;
    }

    .secure-badge svg {
        width: 16px;
        height: 16px;
    }

    .url-display {
        color: #6b7280;
        font-size: 15px;
    }

    .fi-simple-main {
        max-width: none !important;
        padding: 0 !important;
    }

    .fi-simple-main-ctn {
        background: transparent !important;
        box-shadow: none !important;
    }

    .fi-btn {
        border: 1px solid #ddd !important;
    }


    .choices__inner,
    .fi-select-input,
    .fi-input,
    textarea {
        padding: 14px 18px !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 5px !important;
        font-size: 16px !important;
    }


    .choices__inner:hover,
    .fi-select-input:hover,
    .fi-input:focus,
    .fi-input:hover,
    textarea:focus,
    textarea:hover {
        padding: 14px 18px !important;
        border: 2px solid #007a52 !important;

        font-size: 16px !important;
    }

    .fi-btn-primary {
        width: 100% !important;
        padding: 16px !important;
        background: #096 !important;
        border-radius: 5px !important;
        font-size: 17px !important;
        font-weight: 600 !important;
    }

    .fi-btn-primary:hover {
        background: #007a52 !important;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px #0099664d !important;
    }

    .fi-fo-field-wrp-label {
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #374151 !important;
        margin-bottom: 10px !important;
    }

    @media (max-width: 1024px) {

        .fi-simple-layout .container,
        .fi-simple-layout .container-login {
            flex-direction: column;
            max-width: 600px;
        }

        .left-panel,
        .right-panel {
            flex: 1 1 auto;
        }

        .left-panel {
            padding: 30px;
        }

        .slogan {
            font-size: 36px;
        }

        .description {
            font-size: 17px;
        }

        .right-panel {
            padding: 30px 20px;
        }
    }

    @media (max-width: 640px) {
        .fi-simple-layout {
            padding: 10px;
        }

        .fi-simple-layout .container,
        .fi-simple-layout .container-login {
            border-radius: 15px;
            min-height: auto;
        }

        .left-panel {
            display: none !important;
        }

        .logo {
            width: 150px;
            margin-bottom: 30px;
        }

        .slogan {
            font-size: 28px;
            margin-bottom: 20px;
        }

        .description {
            font-size: 15px;
        }

        .login-header h1 {
            font-size: 28px;
        }
    }
}