/* ============================================
   SBY v1.0 - Ana Stil
   Tema: Lavanta & Gül - yumuşak, sıcak
   ============================================ */

:root {
  --primary:    #9b59b6;
  --primary-lt: #d7aefb;
  --primary-dk: #6c3483;
  --accent:     #e91e8c;
  --accent-lt:  #f8bbd9;
  --bg:         #fdf6ff;
  --bg2:        #f3e8ff;
  --surface:    #ffffff;
  --border:     #e2d0f5;
  --text:       #2d1b4e;
  --text-muted: #8e7aab;
  --success:    #27ae60;
  --danger:     #e74c3c;
  --warning:    #f39c12;
  --shadow:     0 4px 20px rgba(155, 89, 182, 0.12);
  --shadow-lg:  0 8px 40px rgba(155, 89, 182, 0.18);
  --radius:     16px;
  --radius-sm:  10px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── GENEL ── */
h1,h2,h3 { font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  color: #fff;
  box-shadow: 0 4px 12px rgba(155,89,182,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(155,89,182,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-ghost:hover { background: var(--bg2); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(155,89,182,0.12);
}

/* ── EKRANLAR ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── AUTH EKRANI ── */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f3e8ff 0%, #fce4ec 100%);
  padding: 1rem;
}

.auth-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo .logo-text {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}
.auth-logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── ANA UYGULAMA ── */
#app-screen {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  box-shadow: 2px 0 12px rgba(155,89,182,0.06);
}

.sidebar-logo {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 0.5rem 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  margin-bottom: 1.5rem;
}
.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-lt), var(--accent-lt));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.user-name { font-weight: 700; font-size: 0.95rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  margin-bottom: 0.25rem;
}
nav a:hover { background: var(--bg2); text-decoration: none; }
nav a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  color: #fff;
  box-shadow: 0 4px 12px rgba(155,89,182,0.25);
}
nav a .icon { font-size: 1.2rem; width: 24px; text-align: center; }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Ana İçerik */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  max-width: 900px;
}

/* ── PİN EKRANI ── */
#pin-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f3e8ff, #fce4ec);
}

.pin-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 2.5rem;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.pin-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.pin-card h2 { margin-bottom: 0.5rem; }
.pin-card p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--primary);
  transition: var(--transition);
}
.pin-dot.filled { background: var(--primary); }

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  max-width: 240px;
  margin: 0 auto 1rem;
}
.pin-key {
  padding: 0;
  height: 60px;
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--bg2);
  color: var(--text);
  border: 2px solid var(--border);
}
.pin-key:hover { background: var(--primary-lt); border-color: var(--primary); }
.pin-key.del { font-size: 1rem; }

/* ── GÜNLÜK MODÜLÜ ── */
.diary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.diary-header h2 { font-size: 1.5rem; }

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-lt);
}

.entry-card .mood { font-size: 1.8rem; margin-bottom: 0.5rem; }
.entry-card .title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.entry-card .date {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.entry-card .fav {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.1rem;
}

/* Yazı Düzenleyici */
.editor-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.mood-picker, .weather-picker {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.mood-btn, .weather-btn {
  font-size: 1.4rem;
  background: var(--bg2);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}
.mood-btn.selected, .weather-btn.selected {
  border-color: var(--primary);
  background: var(--primary-lt);
}

#editor-title {
  font-size: 1.3rem;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}
#editor-title:focus { border-bottom-color: var(--primary); box-shadow: none; }

#editor-content {
  min-height: 300px;
  border: none;
  padding: 0;
  resize: vertical;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}
#editor-content:focus { box-shadow: none; border-color: transparent; }

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.word-count { font-size: 0.85rem; color: var(--text-muted); }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideIn 0.3s ease;
  max-width: 300px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

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

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
    position: fixed;
    z-index: 100;
    height: 100vh;
    width: 260px;
  }
  .sidebar.open { display: flex; }
  .main-content { padding: 1rem; }
}

/* ── LOADING ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; }
