/* ============================================================
   company-switcher.css — Şirket Değiştirici & Çoklu Hesap Menüsü
   Dijigaraj SaaS Platformu
   ============================================================ */

/* ─── Topbar Şirket Tetikleyici ─── */
.company-switcher-trigger {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: width 0.25s ease, min-width 0.25s ease, max-width 0.25s ease, padding 0.25s ease, background-color 0.2s ease, opacity 0.2s ease;
  border-radius: 0;
}

.company-switcher-trigger:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  margin-right: 4px;
  flex: 1;
  min-width: 0;
}

.company-switch-arrow-btn {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  margin-left: auto;
}

.company-switcher-trigger:hover .company-switch-arrow-btn {
  color: var(--text-heading, #fff);
  background: rgba(255, 255, 255, 0.08);
}

.company-switcher-trigger.active .company-switch-arrow-btn {
  transform: rotate(180deg);
  color: var(--accent, #6366f1);
}

/* ─── Açılır Menü (Chrome / Profil Dropdown Stili) ─── */
.company-switcher-dropdown {
  position: absolute;
  top: calc(var(--header-height, 64px) - 6px);
  left: 12px;
  width: 275px;
  background: #1e1e2e;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding: 6px 0;
  animation: csFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.company-switcher-dropdown.show {
  display: flex;
}

@keyframes csFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── 1. Aktif Şirket Tam Ünvan Başlığı ─── */
.cs-active-user {
  display: flex;
  align-items: center;
  padding: 12px 14px 10px;
}

.cs-active-info {
  flex: 1;
  min-width: 0;
}

.cs-active-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  white-space: normal;
  word-break: break-word;
  line-height: 1.38;
}

/* ─── Menü Butonları (.hpd-item ile uyumlu sade stil) ─── */
.cs-item-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text-primary, #e2e8f0);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
  font-family: inherit;
}

.cs-item-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.cs-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
}

/* ─── Diğer Şirketler Bölümü ─── */
.cs-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 4px;
}

.cs-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
}

.cs-section-count {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
}

.cs-other-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 2px 4px;
}

.cs-other-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  margin: 1px 0;
}

.cs-other-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cs-other-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.cs-other-info {
  flex: 1;
  min-width: 0;
}

.cs-other-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.cs-other-role {
  font-size: 0.66rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cs-other-empty {
  padding: 8px 14px 10px;
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
  font-style: italic;
}

.cs-unlink-btn {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0;
  transition: all 0.18s ease;
  margin-left: auto;
}

.cs-other-item:hover .cs-unlink-btn {
  opacity: 1;
}

.cs-unlink-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.cs-add-company-btn {
  color: var(--accent, #8bc53d) !important;
  font-weight: 600;
}

.cs-add-company-btn:hover {
  background: rgba(139, 197, 61, 0.08) !important;
}

/* ─── Kompakt Şirket Değiştir / Bağla Akordeonu ─── */
.cs-switch-accordion-btn {
  font-weight: 600;
}

.cs-switch-accordion-btn.expanded {
  background: rgba(255, 255, 255, 0.04);
}

.cs-accordion-chevron {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-left: 4px;
  transition: transform 0.15s ease;
}

.cs-switch-drawer {
  background: rgba(0, 0, 0, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2px 0 4px;
}

/* ─── Light Tema Uyumları (Sol Üst Şirket Menüsü) ─── */
body.light-theme .company-switcher-dropdown {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

body.light-theme .cs-avatar-cam {
  border-color: #ffffff;
}

body.light-theme .cs-active-title,
body.light-theme .cs-other-name {
  color: #0f172a;
}

body.light-theme .cs-item-btn {
  color: #1e293b;
}

body.light-theme .cs-item-btn:hover,
body.light-theme .cs-other-item:hover,
body.light-theme .cs-switch-accordion-btn.expanded {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

body.light-theme .cs-section-count {
  background: rgba(15, 23, 42, 0.07);
  color: #475569;
}

body.light-theme .cs-switch-drawer {
  background: rgba(15, 23, 42, 0.03);
  border-top-color: rgba(15, 23, 42, 0.07);
}

body.light-theme .cs-add-company-btn {
  color: #4d7c0f !important;
}

/* ─── Aktif Şirket Logosu Değiştir Simgesi ─── */
.cs-item-avatar-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-item-avatar-wrapper .cs-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cs-item-avatar-wrapper.editable:hover .cs-item-avatar {
  border-color: var(--accent, #8bc53d);
  transform: scale(1.04);
}

.cs-avatar-edit-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--accent, #8bc53d);
  color: #051b06;
  border: 2px solid var(--bg-secondary, #171717);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  z-index: 3;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cs-item-avatar-wrapper.editable:hover .cs-avatar-edit-badge {
  transform: scale(1.15);
  background: var(--accent-hover, #9ed054);
}

/* ─── Instagram Tarzı Logo Kırpıcı (Cropper Modal) ─── */
.cs-checkerboard {
  background-color: #1e293b;
  background-image:
    linear-gradient(45deg, #334155 25%, transparent 25%),
    linear-gradient(-45deg, #334155 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #334155 75%),
    linear-gradient(-45deg, transparent 75%, #334155 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.cs-cropper-viewport {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--border-light, #4b4b4b);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.cs-cropper-viewport:active {
  cursor: grabbing;
}

.cs-cropper-guide-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.cs-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  forced-color-adjust: none;
}

.cs-color-swatch:hover {
  transform: scale(1.1);
}

.cs-color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  transform: scale(1.12);
}

.cs-color-dot-preview {
  forced-color-adjust: none;
}
