/*
 * Clinic Type Themes
 * Carregado APÓS dark-theme.css. Seletores mais específicos (.theme-dark .clinic-X *)
 * ganham de dark-theme.css (.theme-dark *) por especificidade — sem !important.
 *
 * Família Medical (default): nenhuma classe extra — usa a paleta azul do app.css.
 * Dental:       .clinic-dental     (#1a7abf teal-blue)
 * Veterinary:   .clinic-veterinary (#1a9152 forest-green)
 * Therapy:      .clinic-therapy    (#6c54b5 soft-indigo)
 *
 * IMPORTANTE: os seletores incluem .clinic-X * para sobrescrever o seletor * do app.css
 * que fixa --primary-color em cada elemento, bloqueando herança. Clinic-themes.css é
 * carregado DEPOIS do dark-theme.css, então ganha por ordem de cascata com mesma especificidade.
 */

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE
   ═══════════════════════════════════════════════════════════════ */

/* ── Dental ─────────────────────────────────────────────────── */
.clinic-dental,
.clinic-dental * {
    --primary-color:    #1a7abf;
    --primary:          #1a7abf;
    --primary-rgb:      26, 122, 191;
    --primary-soft:     rgba(26, 122, 191, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(26, 122, 191, 0.25);
}

.clinic-dental.sidebar,
.clinic-dental .sidebar {
    --sidebar-accent:      #1a7abf;
    --sidebar-accent-rgb:  26, 122, 191;
    --sidebar-accent-soft: rgba(26, 122, 191, 0.10);
}

/* ── Veterinary ─────────────────────────────────────────────── */
.clinic-veterinary,
.clinic-veterinary * {
    --primary-color:    #1a9152;
    --primary:          #1a9152;
    --primary-rgb:      26, 145, 82;
    --primary-soft:     rgba(26, 145, 82, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(26, 145, 82, 0.25);
}

.clinic-veterinary.sidebar,
.clinic-veterinary .sidebar {
    --sidebar-accent:      #1a9152;
    --sidebar-accent-rgb:  26, 145, 82;
    --sidebar-accent-soft: rgba(26, 145, 82, 0.10);
}

/* ── Therapy / Psychology ───────────────────────────────────── */
.clinic-therapy,
.clinic-therapy * {
    --primary-color:    #6c54b5;
    --primary:          #6c54b5;
    --primary-rgb:      108, 84, 181;
    --primary-soft:     rgba(108, 84, 181, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(108, 84, 181, 0.25);
}

.clinic-therapy.sidebar,
.clinic-therapy .sidebar {
    --sidebar-accent:      #6c54b5;
    --sidebar-accent-rgb:  108, 84, 181;
    --sidebar-accent-soft: rgba(108, 84, 181, 0.10);
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — especificidade 0-2-0, bate dark-theme.css (0-1-0)
   Sobrescreve --primary-color e --primary-rgb em TODOS os elementos
   dentro do wrapper de clínica no modo escuro.
   ═══════════════════════════════════════════════════════════════ */

/* ── Dark + Dental ──────────────────────────────────────────── */
.theme-dark .clinic-dental,
.theme-dark .clinic-dental * {
    --primary-color:    #3a9bd5;
    --primary:          #3a9bd5;
    --primary-rgb:      58, 155, 213;
    --primary-soft:     rgba(58, 155, 213, 0.20);
    --box-shadow-focus: 0 0 0 2px rgba(58, 155, 213, 0.35);
}

.theme-dark .clinic-dental .sidebar,
.theme-dark .clinic-dental.sidebar {
    --sidebar-accent:      #3a9bd5;
    --sidebar-accent-rgb:  58, 155, 213;
    --sidebar-accent-soft: rgba(58, 155, 213, 0.15);
}

.theme-dark .clinic-dental .logo-accent,
.theme-dark .clinic-dental .logo-short           { color: #3a9bd5; }
.theme-dark .clinic-dental .menu-item.active      { color: #3a9bd5; background: rgba(58, 155, 213, 0.15); border-left-color: #3a9bd5; }
.theme-dark .clinic-dental .user-avatar           { background: rgba(58, 155, 213, 0.18); border-color: rgba(58, 155, 213, 0.3); color: #3a9bd5; }
.theme-dark .clinic-dental .theme-toggle:hover    { color: #3a9bd5; background: rgba(58, 155, 213, 0.1); }
.theme-dark .clinic-dental .clinic-badge          { background: rgba(58, 155, 213, 0.15); color: #3a9bd5; }

/* ── Dark + Veterinary ──────────────────────────────────────── */
.theme-dark .clinic-veterinary,
.theme-dark .clinic-veterinary * {
    --primary-color:    #2ecc71;
    --primary:          #2ecc71;
    --primary-rgb:      46, 204, 113;
    --primary-soft:     rgba(46, 204, 113, 0.20);
    --box-shadow-focus: 0 0 0 2px rgba(46, 204, 113, 0.35);
}

.theme-dark .clinic-veterinary .sidebar,
.theme-dark .clinic-veterinary.sidebar {
    --sidebar-accent:      #2ecc71;
    --sidebar-accent-rgb:  46, 204, 113;
    --sidebar-accent-soft: rgba(46, 204, 113, 0.15);
}

.theme-dark .clinic-veterinary .logo-accent,
.theme-dark .clinic-veterinary .logo-short        { color: #2ecc71; }
.theme-dark .clinic-veterinary .menu-item.active  { color: #2ecc71; background: rgba(46, 204, 113, 0.15); border-left-color: #2ecc71; }
.theme-dark .clinic-veterinary .user-avatar       { background: rgba(46, 204, 113, 0.18); border-color: rgba(46, 204, 113, 0.3); color: #2ecc71; }
.theme-dark .clinic-veterinary .theme-toggle:hover { color: #2ecc71; background: rgba(46, 204, 113, 0.1); }
.theme-dark .clinic-veterinary .clinic-badge      { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }

/* ── Dark + Therapy ─────────────────────────────────────────── */
.theme-dark .clinic-therapy,
.theme-dark .clinic-therapy * {
    --primary-color:    #9b7de8;
    --primary:          #9b7de8;
    --primary-rgb:      155, 125, 232;
    --primary-soft:     rgba(155, 125, 232, 0.20);
    --box-shadow-focus: 0 0 0 2px rgba(155, 125, 232, 0.35);
}

.theme-dark .clinic-therapy .sidebar,
.theme-dark .clinic-therapy.sidebar {
    --sidebar-accent:      #9b7de8;
    --sidebar-accent-rgb:  155, 125, 232;
    --sidebar-accent-soft: rgba(155, 125, 232, 0.15);
}

.theme-dark .clinic-therapy .logo-accent,
.theme-dark .clinic-therapy .logo-short           { color: #9b7de8; }
.theme-dark .clinic-therapy .menu-item.active     { color: #9b7de8; background: rgba(155, 125, 232, 0.15); border-left-color: #9b7de8; }
.theme-dark .clinic-therapy .user-avatar          { background: rgba(155, 125, 232, 0.18); border-color: rgba(155, 125, 232, 0.3); color: #9b7de8; }
.theme-dark .clinic-therapy .theme-toggle:hover   { color: #9b7de8; background: rgba(155, 125, 232, 0.1); }
.theme-dark .clinic-therapy .clinic-badge         { background: rgba(155, 125, 232, 0.15); color: #9b7de8; }

/* ═══════════════════════════════════════════════════════════════
   MULTISPECIALTY — tema por especialidade de quem logou (não uma
   cor fixa de clínica). Dentist/Veterinarian/Psychologist-Therapist
   reaproveitam clinic-dental/clinic-veterinary/clinic-therapy acima
   (ver ClinicContextService.SpecialtyThemeCssClass). As 6 abaixo são
   as especialidades que ainda não tinham clínica dedicada — cores
   reaproveitadas dos badges dos respectivos *VisitForm.razor.css.
   ═══════════════════════════════════════════════════════════════ */

/* ── Physiotherapy ──────────────────────────────────────────── */
.specialty-physiotherapy,
.specialty-physiotherapy * {
    --primary-color:    #d97706;
    --primary:          #d97706;
    --primary-rgb:      217, 119, 6;
    --primary-soft:     rgba(217, 119, 6, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(217, 119, 6, 0.25);
}
.specialty-physiotherapy.sidebar,
.specialty-physiotherapy .sidebar {
    --sidebar-accent:      #d97706;
    --sidebar-accent-rgb:  217, 119, 6;
    --sidebar-accent-soft: rgba(217, 119, 6, 0.10);
}

/* ── Nutrition ──────────────────────────────────────────────── */
.specialty-nutrition,
.specialty-nutrition * {
    --primary-color:    #c2185b;
    --primary:          #c2185b;
    --primary-rgb:      194, 24, 91;
    --primary-soft:     rgba(194, 24, 91, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(194, 24, 91, 0.25);
}
.specialty-nutrition.sidebar,
.specialty-nutrition .sidebar {
    --sidebar-accent:      #c2185b;
    --sidebar-accent-rgb:  194, 24, 91;
    --sidebar-accent-soft: rgba(194, 24, 91, 0.10);
}

/* ── Chiropractic ───────────────────────────────────────────── */
.specialty-chiropractic,
.specialty-chiropractic * {
    --primary-color:    #0891b2;
    --primary:          #0891b2;
    --primary-rgb:      8, 145, 178;
    --primary-soft:     rgba(8, 145, 178, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(8, 145, 178, 0.25);
}
.specialty-chiropractic.sidebar,
.specialty-chiropractic .sidebar {
    --sidebar-accent:      #0891b2;
    --sidebar-accent-rgb:  8, 145, 178;
    --sidebar-accent-soft: rgba(8, 145, 178, 0.10);
}

/* ── Podiatry ───────────────────────────────────────────────── */
.specialty-podiatry,
.specialty-podiatry * {
    --primary-color:    #92400e;
    --primary:          #92400e;
    --primary-rgb:      146, 64, 14;
    --primary-soft:     rgba(146, 64, 14, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(146, 64, 14, 0.25);
}
.specialty-podiatry.sidebar,
.specialty-podiatry .sidebar {
    --sidebar-accent:      #92400e;
    --sidebar-accent-rgb:  146, 64, 14;
    --sidebar-accent-soft: rgba(146, 64, 14, 0.10);
}

/* ── Ophthalmology ──────────────────────────────────────────── */
.specialty-ophthalmology,
.specialty-ophthalmology * {
    --primary-color:    #4338ca;
    --primary:          #4338ca;
    --primary-rgb:      67, 56, 202;
    --primary-soft:     rgba(67, 56, 202, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(67, 56, 202, 0.25);
}
.specialty-ophthalmology.sidebar,
.specialty-ophthalmology .sidebar {
    --sidebar-accent:      #4338ca;
    --sidebar-accent-rgb:  67, 56, 202;
    --sidebar-accent-soft: rgba(67, 56, 202, 0.10);
}

/* ── Speech Therapy ─────────────────────────────────────────── */
.specialty-speech-therapy,
.specialty-speech-therapy * {
    --primary-color:    #65a30d;
    --primary:          #65a30d;
    --primary-rgb:      101, 163, 13;
    --primary-soft:     rgba(101, 163, 13, 0.10);
    --box-shadow-focus: 0 0 0 2px rgba(101, 163, 13, 0.25);
}
.specialty-speech-therapy.sidebar,
.specialty-speech-therapy .sidebar {
    --sidebar-accent:      #65a30d;
    --sidebar-accent-rgb:  101, 163, 13;
    --sidebar-accent-soft: rgba(101, 163, 13, 0.10);
}

/* ── Dark + Physiotherapy ───────────────────────────────────── */
.theme-dark .specialty-physiotherapy,
.theme-dark .specialty-physiotherapy * {
    --primary-color: #f5a742; --primary: #f5a742; --primary-rgb: 245, 167, 66;
    --primary-soft: rgba(245, 167, 66, 0.20); --box-shadow-focus: 0 0 0 2px rgba(245, 167, 66, 0.35);
}
.theme-dark .specialty-physiotherapy .sidebar,
.theme-dark .specialty-physiotherapy.sidebar {
    --sidebar-accent: #f5a742; --sidebar-accent-rgb: 245, 167, 66; --sidebar-accent-soft: rgba(245, 167, 66, 0.15);
}
.theme-dark .specialty-physiotherapy .logo-accent,
.theme-dark .specialty-physiotherapy .logo-short          { color: #f5a742; }
.theme-dark .specialty-physiotherapy .menu-item.active     { color: #f5a742; background: rgba(245, 167, 66, 0.15); border-left-color: #f5a742; }
.theme-dark .specialty-physiotherapy .user-avatar          { background: rgba(245, 167, 66, 0.18); border-color: rgba(245, 167, 66, 0.3); color: #f5a742; }
.theme-dark .specialty-physiotherapy .theme-toggle:hover   { color: #f5a742; background: rgba(245, 167, 66, 0.1); }
.theme-dark .specialty-physiotherapy .clinic-badge         { background: rgba(245, 167, 66, 0.15); color: #f5a742; }

/* ── Dark + Nutrition ───────────────────────────────────────── */
.theme-dark .specialty-nutrition,
.theme-dark .specialty-nutrition * {
    --primary-color: #ec4899; --primary: #ec4899; --primary-rgb: 236, 72, 153;
    --primary-soft: rgba(236, 72, 153, 0.20); --box-shadow-focus: 0 0 0 2px rgba(236, 72, 153, 0.35);
}
.theme-dark .specialty-nutrition .sidebar,
.theme-dark .specialty-nutrition.sidebar {
    --sidebar-accent: #ec4899; --sidebar-accent-rgb: 236, 72, 153; --sidebar-accent-soft: rgba(236, 72, 153, 0.15);
}
.theme-dark .specialty-nutrition .logo-accent,
.theme-dark .specialty-nutrition .logo-short          { color: #ec4899; }
.theme-dark .specialty-nutrition .menu-item.active     { color: #ec4899; background: rgba(236, 72, 153, 0.15); border-left-color: #ec4899; }
.theme-dark .specialty-nutrition .user-avatar          { background: rgba(236, 72, 153, 0.18); border-color: rgba(236, 72, 153, 0.3); color: #ec4899; }
.theme-dark .specialty-nutrition .theme-toggle:hover   { color: #ec4899; background: rgba(236, 72, 153, 0.1); }
.theme-dark .specialty-nutrition .clinic-badge         { background: rgba(236, 72, 153, 0.15); color: #ec4899; }

/* ── Dark + Chiropractic ────────────────────────────────────── */
.theme-dark .specialty-chiropractic,
.theme-dark .specialty-chiropractic * {
    --primary-color: #22d3ee; --primary: #22d3ee; --primary-rgb: 34, 211, 238;
    --primary-soft: rgba(34, 211, 238, 0.20); --box-shadow-focus: 0 0 0 2px rgba(34, 211, 238, 0.35);
}
.theme-dark .specialty-chiropractic .sidebar,
.theme-dark .specialty-chiropractic.sidebar {
    --sidebar-accent: #22d3ee; --sidebar-accent-rgb: 34, 211, 238; --sidebar-accent-soft: rgba(34, 211, 238, 0.15);
}
.theme-dark .specialty-chiropractic .logo-accent,
.theme-dark .specialty-chiropractic .logo-short          { color: #22d3ee; }
.theme-dark .specialty-chiropractic .menu-item.active     { color: #22d3ee; background: rgba(34, 211, 238, 0.15); border-left-color: #22d3ee; }
.theme-dark .specialty-chiropractic .user-avatar          { background: rgba(34, 211, 238, 0.18); border-color: rgba(34, 211, 238, 0.3); color: #22d3ee; }
.theme-dark .specialty-chiropractic .theme-toggle:hover   { color: #22d3ee; background: rgba(34, 211, 238, 0.1); }
.theme-dark .specialty-chiropractic .clinic-badge         { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }

/* ── Dark + Podiatry ────────────────────────────────────────── */
.theme-dark .specialty-podiatry,
.theme-dark .specialty-podiatry * {
    --primary-color: #d9915a; --primary: #d9915a; --primary-rgb: 217, 145, 90;
    --primary-soft: rgba(217, 145, 90, 0.20); --box-shadow-focus: 0 0 0 2px rgba(217, 145, 90, 0.35);
}
.theme-dark .specialty-podiatry .sidebar,
.theme-dark .specialty-podiatry.sidebar {
    --sidebar-accent: #d9915a; --sidebar-accent-rgb: 217, 145, 90; --sidebar-accent-soft: rgba(217, 145, 90, 0.15);
}
.theme-dark .specialty-podiatry .logo-accent,
.theme-dark .specialty-podiatry .logo-short          { color: #d9915a; }
.theme-dark .specialty-podiatry .menu-item.active     { color: #d9915a; background: rgba(217, 145, 90, 0.15); border-left-color: #d9915a; }
.theme-dark .specialty-podiatry .user-avatar          { background: rgba(217, 145, 90, 0.18); border-color: rgba(217, 145, 90, 0.3); color: #d9915a; }
.theme-dark .specialty-podiatry .theme-toggle:hover   { color: #d9915a; background: rgba(217, 145, 90, 0.1); }
.theme-dark .specialty-podiatry .clinic-badge         { background: rgba(217, 145, 90, 0.15); color: #d9915a; }

/* ── Dark + Ophthalmology ───────────────────────────────────── */
.theme-dark .specialty-ophthalmology,
.theme-dark .specialty-ophthalmology * {
    --primary-color: #818cf8; --primary: #818cf8; --primary-rgb: 129, 140, 248;
    --primary-soft: rgba(129, 140, 248, 0.20); --box-shadow-focus: 0 0 0 2px rgba(129, 140, 248, 0.35);
}
.theme-dark .specialty-ophthalmology .sidebar,
.theme-dark .specialty-ophthalmology.sidebar {
    --sidebar-accent: #818cf8; --sidebar-accent-rgb: 129, 140, 248; --sidebar-accent-soft: rgba(129, 140, 248, 0.15);
}
.theme-dark .specialty-ophthalmology .logo-accent,
.theme-dark .specialty-ophthalmology .logo-short          { color: #818cf8; }
.theme-dark .specialty-ophthalmology .menu-item.active     { color: #818cf8; background: rgba(129, 140, 248, 0.15); border-left-color: #818cf8; }
.theme-dark .specialty-ophthalmology .user-avatar          { background: rgba(129, 140, 248, 0.18); border-color: rgba(129, 140, 248, 0.3); color: #818cf8; }
.theme-dark .specialty-ophthalmology .theme-toggle:hover   { color: #818cf8; background: rgba(129, 140, 248, 0.1); }
.theme-dark .specialty-ophthalmology .clinic-badge         { background: rgba(129, 140, 248, 0.15); color: #818cf8; }

/* ── Dark + Speech Therapy ──────────────────────────────────── */
.theme-dark .specialty-speech-therapy,
.theme-dark .specialty-speech-therapy * {
    --primary-color: #a3e635; --primary: #a3e635; --primary-rgb: 163, 230, 53;
    --primary-soft: rgba(163, 230, 53, 0.20); --box-shadow-focus: 0 0 0 2px rgba(163, 230, 53, 0.35);
}
.theme-dark .specialty-speech-therapy .sidebar,
.theme-dark .specialty-speech-therapy.sidebar {
    --sidebar-accent: #a3e635; --sidebar-accent-rgb: 163, 230, 53; --sidebar-accent-soft: rgba(163, 230, 53, 0.15);
}
.theme-dark .specialty-speech-therapy .logo-accent,
.theme-dark .specialty-speech-therapy .logo-short          { color: #a3e635; }
.theme-dark .specialty-speech-therapy .menu-item.active     { color: #a3e635; background: rgba(163, 230, 53, 0.15); border-left-color: #a3e635; }
.theme-dark .specialty-speech-therapy .user-avatar          { background: rgba(163, 230, 53, 0.18); border-color: rgba(163, 230, 53, 0.3); color: #a3e635; }
.theme-dark .specialty-speech-therapy .theme-toggle:hover   { color: #a3e635; background: rgba(163, 230, 53, 0.1); }
.theme-dark .specialty-speech-therapy .clinic-badge         { background: rgba(163, 230, 53, 0.15); color: #a3e635; }
