/*
 * Reevio Theme Override
 * Primary color: #4F2D9F (indigo)
 * Accent color: #F5C518 (yellow/gold)
 * This file overrides the default theme with the Reevio brand indigo
 */

:root {
    /* Reevio Indigo Palette */
    --reevio-50: #F3EEFF;
    --reevio-100: #E6DCFF;
    --reevio-200: #CDBAFE;
    --reevio-300: #A98AED;
    --reevio-400: #6B44C4;
    --reevio-500: #4F2D9F;
    --reevio-600: #3A1D7E;
    --reevio-700: #2E1765;
    --reevio-800: #231050;
    --reevio-900: #1A0C3B;
    --reevio-950: #1A1128;

    /* Reevio Accent (Yellow/Gold) */
    --reevio-accent: #F5C518;
    --reevio-accent-light: #FDE68A;
    --reevio-accent-dark: #D4A510;

    /* Override primary with Reevio indigo */
    --primary: #4F2D9F !important;
    --primary-foreground: #ffffff !important;

    /* Ring color for focus states */
    --ring: #6B44C4 !important;
}

.dark {
    /* Dark mode primary - slightly lighter for better visibility */
    --primary: #6B44C4 !important;
    --primary-foreground: #ffffff !important;

    /* Background with indigo tint instead of blue */
    --background: #0D0A14 !important;
    --foreground: #F3EEFF !important;

    --card: #14101E !important;
    --card-foreground: #F3EEFF !important;

    --popover: #14101E !important;
    --popover-foreground: #F3EEFF !important;

    --secondary: #1A1128 !important;
    --secondary-foreground: #F3EEFF !important;

    --muted: #171025 !important;
    --muted-foreground: #9A8FB5 !important;

    --accent: #1D1430 !important;
    --accent-foreground: #F3EEFF !important;

    --border: #2A2044 !important;
    --input: #2A2044 !important;
    --ring: #4F2D9F !important;
}

/* Button primary override */
.btn-primary,
.kt-btn-primary {
    background-color: #4F2D9F !important;
    border-color: #4F2D9F !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.kt-btn-primary:hover {
    background-color: #3A1D7E !important;
    border-color: #3A1D7E !important;
}

.btn-primary:active,
.btn-primary:focus {
    background-color: #2E1765 !important;
    border-color: #2E1765 !important;
}

/* Text primary color */
.text-primary {
    color: #4F2D9F !important;
}

.dark .text-primary {
    color: #A98AED !important;
}

/* Background primary */
.bg-primary {
    background-color: #4F2D9F !important;
}

/* Background primary with opacity */
.bg-primary\/10 {
    background-color: rgba(79, 45, 159, 0.1) !important;
}

/* Border primary */
.border-primary {
    border-color: #4F2D9F !important;
}

/* Focus ring */
*:focus-visible {
    outline-color: #4F2D9F !important;
}

/* Checkbox and radio checked states */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #4F2D9F !important;
    border-color: #4F2D9F !important;
}

/* Select focus */
select:focus {
    border-color: #4F2D9F !important;
    box-shadow: 0 0 0 3px rgba(79, 45, 159, 0.2) !important;
}

/* Input focus */
input:focus,
textarea:focus {
    border-color: #4F2D9F !important;
    box-shadow: 0 0 0 3px rgba(79, 45, 159, 0.2) !important;
}

/* Badge primary */
.badge-primary {
    background-color: #4F2D9F !important;
    color: #ffffff !important;
}

/* Links in primary color */
a.text-primary:hover {
    color: #2E1765 !important;
}

/* Accent color utilities */
.text-accent {
    color: #F5C518 !important;
}

.bg-accent {
    background-color: #F5C518 !important;
}

/* Star rating accent color */
.star-rating .star-filled {
    color: #F5C518;
}

/* Progress bar (AI responses) */
.ai-progress-bar {
    background: linear-gradient(90deg, #4F2D9F, #6B44C4) !important;
}

/* Dark mode specific overrides for common elements */
.dark .bg-gray-800 {
    background-color: #171025 !important;
}

.dark .bg-gray-900 {
    background-color: #0D0A14 !important;
}

.dark .border-gray-700 {
    border-color: #2A2044 !important;
}

.dark .border-gray-800 {
    border-color: #1A1128 !important;
}

/* Card backgrounds in dark mode */
.dark .card {
    background-color: #14101E !important;
    border-color: #2A2044 !important;
}

/* Sidebar in dark mode */
.dark .sidebar,
.dark [class*="sidebar"] {
    background-color: #0D0A14 !important;
}

/* Table stripes in dark mode */
.dark .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(79, 45, 159, 0.05) !important;
}

/* Hover states in dark mode */
.dark .hover\:bg-gray-800:hover {
    background-color: #1D1430 !important;
}

/* ============================================
   Onboarding Stepper
   ============================================ */

.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0 auto;
    max-width: 400px;
}

.stepper-step {
    display: flex;
    align-items: center;
}

.stepper-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #d1d5db;
    color: #9ca3af;
    background: #ffffff;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.stepper-dot.active {
    border-color: #4F2D9F;
    color: #ffffff;
    background: #4F2D9F;
    box-shadow: 0 0 0 4px rgba(79, 45, 159, 0.15);
}

.stepper-dot.completed {
    border-color: #22c55e;
    color: #ffffff;
    background: #22c55e;
}

.stepper-dot.completed::after {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg);
    margin-top: -2px;
}

.stepper-dot.completed span {
    display: none;
}

.stepper-line {
    width: 48px;
    height: 2px;
    background: #d1d5db;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.stepper-line.completed {
    background: #22c55e;
}

/* ============================================
   SIRET Search Modal (Dialog)
   ============================================ */

.siret-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.siret-dialog-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.siret-dialog {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.siret-dialog-backdrop.open .siret-dialog {
    transform: scale(1);
}

.siret-dialog-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.siret-dialog-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.siret-dialog-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: background 0.15s;
}

.siret-dialog-close:hover {
    background: #f3f4f6;
}

.siret-dialog-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.siret-dialog-search {
    position: relative;
    margin-bottom: 1rem;
}

.siret-dialog-search input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.siret-dialog-search input:focus {
    border-color: #4F2D9F;
    box-shadow: 0 0 0 3px rgba(79, 45, 159, 0.15);
}

.siret-dialog-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.siret-result-item {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.siret-result-item:hover {
    border-color: #4F2D9F;
    background: #F3EEFF;
}

.siret-result-item .company-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
}

.siret-result-item .company-details {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.siret-result-item .company-siret {
    font-size: 0.75rem;
    color: #4F2D9F;
    font-family: monospace;
    margin-top: 0.125rem;
}

.siret-loading,
.siret-no-results {
    text-align: center;
    padding: 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.siret-loading .spinner-sm {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #4F2D9F;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-bottom: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Onboarding Step Content
   ============================================ */

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
    animation: fadeInStep 0.3s ease;
}

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

/* Location checkbox card for step 3 */
.location-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}

.location-card:hover {
    border-color: #4F2D9F;
    background: #F3EEFF;
}

.location-card input[type="checkbox"]:checked ~ .location-info {
    color: #4F2D9F;
}

.location-info .location-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #111827;
}

.location-info .location-address {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Sync progress */
.sync-progress-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.sync-progress-item .sync-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #4F2D9F;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

.sync-progress-item .sync-check {
    color: #22c55e;
    flex-shrink: 0;
}

.sync-progress-item .sync-error {
    color: #ef4444;
    flex-shrink: 0;
}
