:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --secondary-color: #ec4899;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================
   CONTAINER
   ========================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ==========================================
   AUTH PAGES (Login / Register / Admin Login)
   ========================================== */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  padding: 1rem;
}

.auth-card {
  background: var(--card-bg);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.5s ease-out;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* ==========================================
   FORMS
   ========================================== */
.form-group {
  margin-bottom: 1rem;
}

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

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--card-bg);
  color: var(--text-dark);
}

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

.form-control::placeholder {
  color: #94a3b8;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-align: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-family: inherit;
  gap: 0.375rem;
  text-decoration: none;
  line-height: 1.4;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.btn-full {
  width: 100%;
}

.auth-card .btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.auth-toggle {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.auth-toggle a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* ==========================================
   DASHBOARD - HEADER
   ========================================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.header h1 {
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 700;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-info span {
  font-size: 0.85rem;
  color: var(--text-light);
}

.btn-logout {
  background: none;
  border: 1.5px solid var(--danger);
  color: var(--danger);
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-logout:hover {
  background: var(--danger);
  color: white;
}

/* ==========================================
   DASHBOARD - MAIN LAYOUT
   ========================================== */
.main-content {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.sidebar, .calendar-area {
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.sidebar h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

/* ==========================================
   AUTHOR LIST
   ========================================== */
.author-list {
  list-style: none;
  max-height: 500px;
  overflow-y: auto;
  margin-top: 0.75rem;
}

.author-item {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border-color);
  margin-bottom: 0.375rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-dark);
}

.author-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.author-item.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ==========================================
   CALENDAR
   ========================================== */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.calendar-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.calendar-header .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.375rem;
}

.day-name {
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-light);
  padding: 0.375rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 0.375rem;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  font-size: 0.85rem;
  position: relative;
  border: 1px solid transparent;
  overflow: hidden;
}

.day-cell:hover:not(.booked):not(.empty):not(.past) {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(1.03);
}

.day-cell.empty {
  background-color: transparent;
  border: none;
  cursor: default;
}

.day-cell.past {
  background-color: #f1f5f9;
  color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.6;
}

.day-cell.booked {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: white;
  cursor: default;
  border: none;
}

.booked-badge {
  font-size: 0.55rem;
  line-height: 1.3;
  text-align: center;
  padding: 2px 3px;
  margin-top: 1px;
  max-width: 100%;
  overflow: hidden;
  word-break: break-word;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ==========================================
   MODALS
   ========================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background-color: var(--card-bg);
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: slideUp 0.3s ease-out;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.25rem;
}

.close-modal {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  transition: color 0.15s;
}

.close-modal:hover {
  color: var(--danger);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================
   YAZAR TAKVİMİ SAYFASI
   ========================================== */
.yazar-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.yazar-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.yazar-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.375rem;
}

.yazar-header p {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ==========================================
   ADMIN TABLE
   ========================================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.admin-table tr:hover {
  background-color: var(--bg-color);
}

.admin-table td {
  vertical-align: middle;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.badge-edited {
  background: var(--secondary-color);
}

.action-btn {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ==========================================
   ADMIN SECTION CARDS
   ========================================== */
.admin-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.admin-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.admin-section p {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */
@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }

  /* Header */
  .header {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    padding: 1rem;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .user-info {
    justify-content: center;
    gap: 0.5rem;
  }

  .user-info span {
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
  }

  /* Main layout */
  .main-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sidebar {
    padding: 1rem;
  }

  .sidebar h3 {
    font-size: 0.95rem;
  }

  .author-list {
    max-height: 180px;
    overflow-y: auto;
  }

  .author-item {
    padding: 0.5rem 0.625rem;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  /* Calendar */
  .calendar-area {
    padding: 1rem;
  }

  .calendar-header {
    gap: 0.25rem;
  }

  .calendar-header h2 {
    font-size: 0.95rem;
  }

  .calendar-header .btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }

  .calendar-grid {
    gap: 0.2rem;
  }

  .day-name {
    font-size: 0.65rem;
    padding: 0.25rem 0;
  }

  .day-cell {
    font-size: 0.7rem;
    padding-top: 0.25rem;
    border-radius: 0.25rem;
  }

  .booked-badge {
    font-size: 0.45rem;
    padding: 1px 2px;
    line-height: 1.2;
  }

  /* Auth pages */
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-md);
  }

  .auth-card h2 {
    font-size: 1.3rem;
  }

  /* Modals */
  .modal-content {
    padding: 1.5rem 1.25rem;
    margin: 0.5rem;
    max-width: 100%;
  }

  /* Admin tables */
  .admin-table th,
  .admin-table td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .action-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
  }

  /* Yazar sayfası */
  .yazar-container {
    padding: 1rem 0.75rem;
  }

  .yazar-header h1 {
    font-size: 1.1rem;
  }
}

/* Extra small screens */
@media (max-width: 420px) {
  .day-cell {
    aspect-ratio: auto;
    min-height: 48px;
  }

  .booked-badge {
    font-size: 0.4rem;
  }

  .calendar-header .btn {
    padding: 0.25rem 0.375rem;
    font-size: 0.65rem;
  }

  .calendar-header h2 {
    font-size: 0.85rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
  }
}
