/* ============================================
   VARDIYA TAKVİMİ - Modern Sade Tema
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Ana Renkler */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;

  /* Arka Plan */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;

  /* Metin */
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Border & Shadows */
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Durum Renkleri */
  --success: #22c55e;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --error: #ef4444;
  --error-light: #fef2f2;

  /* Diğer */
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

/* ============================================
   DARK MODE
   ============================================ */

[data-theme="dark"] {
  /* Ana Renkler */
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-light: #1e3a5f;

  /* Arka Plan */
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #1e293b;

  /* Metin */
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  /* Border & Shadows */
  --border: #334155;
  --border-focus: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

  /* Durum Renkleri */
  --success: #4ade80;
  --success-light: #14532d;
  --warning: #fbbf24;
  --warning-light: #422006;
  --error: #f87171;
  --error-light: #450a0a;
}

/* Dark mode loading overlay */
[data-theme="dark"] .loading-overlay {
  background: rgba(15, 23, 42, 0.95);
}

/* Dark mode cropper area */
[data-theme="dark"] #cropperContainer > div {
  background: #334155 !important;
}

/* ============================================
   GENEL STİLLER
   ============================================ */

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ============================================
   KART BİLEŞENLERİ
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   BAŞLIKLAR
   ============================================ */

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-align: center;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

/* ============================================
   FORM ELEMANLARI
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input::placeholder {
  color: var(--text-light);
}

.textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================
   BUTONLAR
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #16a34a;
  transform: translateY(-1px);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ============================================
   YÜKLEME ALANI
   ============================================ */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  background: var(--bg);
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-muted);
}

.upload-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.upload-text strong {
  color: var(--primary);
}

/* ============================================
   İLERLEME ÇUBUĞU
   ============================================ */

.progress {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ============================================
   CHECKBOX & TOGGLE
   ============================================ */

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox:focus {
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============================================
   AKTİVİTE KARTLARI
   ============================================ */

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.activity-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: var(--transition);
}

.activity-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.activity-card.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.activity-label {
  font-weight: 500;
  color: var(--text);
}

/* ============================================
   ÖNİZLEME LİSTESİ
   ============================================ */

.preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.preview-item:last-child {
  margin-bottom: 0;
}

.preview-day {
  font-weight: 600;
  color: var(--primary);
}

.preview-time {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   YÜKLEME OVERLAY
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ============================================
   UYARI / BİLGİ KUTULARI
   ============================================ */

.alert {
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.alert-info {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary-hover);
}

.alert-success {
  background: var(--success-light);
  border: 1px solid var(--success);
  color: #166534;
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid var(--warning);
  color: #b45309;
}

.alert-error {
  background: var(--error-light);
  border: 1px solid var(--error);
  color: #b91c1c;
}

/* ============================================
   GELİŞMİŞ MOD TOGGLE
   ============================================ */

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.mode-toggle-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-switch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-switch.active {
  background: var(--primary);
}

.toggle-switch.active::after {
  left: 26px;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }

  .card {
    padding: 16px;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .btn-group {
    flex-direction: column;
  }
}

/* ============================================
   LAYOUT YARDIMCILARI
   ============================================ */

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

.space-y-4 > * + * {
  margin-top: 16px;
}

.space-y-6 > * + * {
  margin-top: 24px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ============================================
   GEÇİŞ ANİMASYONLARI
   ============================================ */

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

/* Cropper Container */
.cropper-container {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ============================================
   ŞABLON BUTONLARI
   ============================================ */

.template-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.template-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.template-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ============================================
   DİL SEÇİCİ
   ============================================ */

.language-selector {
  z-index: 100;
}

.language-selector select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
}

.language-selector select:hover {
  border-color: var(--primary);
}

/* ============================================
   TOAST BİLDİRİMLER
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease-out;
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

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

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============================================
   RESPONSIVE EKLEMELERİ
   ============================================ */

@media (max-width: 768px) {
  .language-selector {
    position: static !important;
    text-align: center;
    margin-bottom: 16px;
  }
  
  .template-grid {
    justify-content: center;
  }
  
  .toast-container {
    left: 16px;
    right: 16px;
  }
  
  .toast {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }
}

/* ============================================
   TEMA TOGGLE BUTONU
   ============================================ */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.theme-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text);
  transition: var(--transition);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* Header Controls Container */
.header-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
}

@media (max-width: 768px) {
  .header-controls {
    position: static;
    justify-content: center;
    margin-bottom: 16px;
  }
}

/* ============================================
   MODAL
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.modal.hidden {
  display: none;
}

.modal-content {
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.3s ease-out;
}

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

/* Dark mode modal */
[data-theme="dark"] .modal {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] #qrCodeContainer {
  background: #1e293b !important;
}

/* ============================================
   DİJİTAL ACENTELİK
   ============================================ */

.dijital-acentelik-card {
  margin-top: 16px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dijital-header {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.dijital-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dijital-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.dijital-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toggle Switch (iOS Style) */
.dijital-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.dijital-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dijital-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: all 0.3s ease;
  border-radius: 28px;
}

.dijital-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.dijital-toggle input:checked + .dijital-slider {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
}

.dijital-toggle input:checked + .dijital-slider:before {
  transform: translateX(24px);
}

/* Days Container */
.dijital-days-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dijital-days-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.dijital-days-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Day Pill Buttons */
.day-pill {
  position: relative;
  cursor: pointer;
}

.day-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.day-pill span {
  display: inline-block;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 20px;
  transition: all 0.2s ease;
  user-select: none;
}

.day-pill:hover span {
  border-color: var(--primary);
  color: var(--primary);
}

.day-pill input:checked + span {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transform: scale(1.02);
}

/* Dark mode */
[data-theme="dark"] .dijital-acentelik-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-card) 100%);
}

[data-theme="dark"] .dijital-slider {
  background-color: #374151;
}

[data-theme="dark"] .day-pill span {
  background: var(--bg-card);
}
