/* ================================================================
   YÜKSEK UÇUŞ - COMPONENTS.CSS
   Butonlar, Alertler, Toastlar, Form Elemanları, Kartlar
   ================================================================ */

/* ==================== BUTONLAR ==================== */
.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* Primary - Vurgulu eylem */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px var(--accent-hover);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 3px 10px var(--accent-hover);
}

/* Ghost - İkincil eylem */
.btn-ghost {
  color: var(--text-dim);
  background: var(--bg-input);
  border-color: var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--border-focus);
}

/* Success - Başarı eylemi */
.btn-success {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 2px 8px var(--success-soft);
}

.btn-success:hover:not(:disabled) {
  background: #27913c;
  box-shadow: 0 4px 16px var(--success-hover);
}

/* Danger - Tehlikeli eylem */
.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 2px 8px var(--danger-soft);
}

.btn-danger:hover:not(:disabled) {
  background: #c92a2a;
  box-shadow: 0 4px 16px var(--danger-hover);
}

/* Warning - Dikkat eylemi */
.btn-warning {
  color: #fff;
  background: var(--warning);
  border-color: var(--warning);
}

.btn-warning:hover:not(:disabled) {
  background: #e08200;
}

/* Accent - Özel eylem */
.btn-accent {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-strong);
}

/* Link */
.btn-link {
  color: var(--accent);
  background: transparent;
  border-color: transparent;
  padding: 0;
  min-height: auto;
}

.btn-link:hover:not(:disabled) {
  text-decoration: underline;
  transform: none;
}

/* Boyutlar */
.btn-sm {
  min-height: 27px;
  padding: 4px 9px;
  font-size: 12px;
}

.btn-lg {
  min-height: 40px;
  padding: 9px 18px;
  font-size: 14px;
}

/* Tam genişlik */
.btn-block {
  width: 100%;
}

/* Sadece ikon */
.btn-icon {
  width: 38px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 30px;
}

/* loading durumu */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}


/* ==================== FORM ELEMANLARI ==================== */
.input,
.textarea,
.select {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.textarea {
  min-height: 80px;
  resize: vertical;
  padding: var(--space-sm);
}

.select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239595a8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-input-focus);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elemanı sarmalayıcı */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.field-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.field-error {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
}

.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

/* Checkbox & Radio */
.checkbox,
.radio {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.checkbox input,
.radio input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 40px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background var(--transition-fast);
  position: relative;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
}

.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}


/* ==================== ALERT ==================== */
.alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.alert-success {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.alert-danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: var(--warning);
}

.alert-info {
  background: var(--info-soft);
  border-color: var(--info);
  color: var(--info);
}

/* Alert kapatma */
.alert-dismissible {
  padding-right: 40px;
}

.alert-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
}

.alert-close:hover {
  opacity: 1;
}


/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  animation: slideInRight 0.25s ease both;
  pointer-events: auto;
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.toast-message {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.toast-close {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text);
}

/* Toast renkleri */
.toast-success {
  border-left: 3px solid var(--success);
}

.toast-danger {
  border-left: 3px solid var(--danger);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-info {
  border-left: 3px solid var(--info);
}


/* ==================== BADGE ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info);
}

/* Noktalı badge */
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}


/* ==================== AVATAR ==================== */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.avatar-accent {
  background: var(--accent-soft);
  color: var(--accent);
}


/* ==================== CHIP ==================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
}

.chip-success {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.chip-danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.chip-warning {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: var(--warning);
}


/* ==================== DROPDOWN ==================== */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  margin-top: var(--space-xs);
  padding: var(--space-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-sm);
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--accent-soft);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xs) 0;
}


/* ==================== TABS ==================== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}


/* ==================== PROGRESS BAR ==================== */
.progress {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width var(--transition-normal);
}

.progress-success .progress-bar {
  background: var(--success);
}

.progress-warning .progress-bar {
  background: var(--warning);
}

.progress-danger .progress-bar {
  background: var(--danger);
}


/* ==================== LOADING ==================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ==================== EMPTY STATE ==================== */
.empty-state {
  padding: var(--space-xl);
  text-align: center;
}

.empty-state-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-sm);
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.empty-state-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto var(--space-md);
}


/* ==================== MODAL TRIGGER ==================== */
[data-toggle="modal"] {
  cursor: pointer;
}


/* ==================== UTILITY CLASSES ==================== */
.panel-gap { margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field-grow { flex: 1; min-width: 200px; }
.field-sm { flex: 1; min-width: 150px; }
.stack { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }


/* ==================== CONFIRM DIALOG ==================== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--overlay);
  display: grid;
  place-items: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-box {
  width: 100%;
  max-width: 400px;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: scaleIn 0.2s ease both;
}

.confirm-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-sm);
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.confirm-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.confirm-text {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}
