/* ============================================================
   POPOMUNDO — frontend/static/css/main.css
   Design tokens, layout, dark theme base.
   MAX ~300 lines
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --clr-bg:          #0d0d14;
  --clr-surface:     #16162a;
  --clr-surface-2:   #1e1e38;
  --clr-surface-3:   #26264a;
  --clr-border:      #2e2e56;
  --clr-primary:     #7b5cfa;
  --clr-primary-h:   #9b7cff;
  --clr-accent:      #f5a623;
  --clr-success:     #2ecc71;
  --clr-danger:      #e74c3c;
  --clr-warn:        #f39c12;
  --clr-text:        #e8e8f0;
  --clr-text-muted:  #7878a0;
  --clr-text-dim:    #4a4a70;
  --radius:          10px;
  --radius-sm:       6px;
  --shadow:          0 4px 24px rgba(0,0,0,0.5);
  --transition:      0.18s ease;
  --topbar-h:        56px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', system-ui, sans-serif; }
body {
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.5;
  overflow: hidden;
}
a { color: var(--clr-primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  background: var(--clr-surface-3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  padding: 8px 12px;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
}
input:focus, select:focus { border-color: var(--clr-primary); }
select { appearance: auto; }

/* ── Utilities ── */
.hidden { display: none !important; }
.mt-4 { margin-top: 1rem; }
.error-text {
  color: var(--clr-danger); font-size: 0.88rem; margin-top: 10px;
  padding: 8px 12px;
  background: rgba(231,76,60,0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--clr-danger);
  line-height: 1.4;
}

/* ── Loading Screen ── */
.loading-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--clr-bg);
  z-index: 999;
}
.loading-logo { font-size: 4rem; animation: pulse 1.5s infinite; }
.loading-title {
  font-size: 2rem; font-weight: 800;
  letter-spacing: 6px; color: var(--clr-primary);
  margin: 12px 0 24px;
}
.loading-bar {
  width: 240px; height: 4px;
  background: var(--clr-surface-3); border-radius: 2px;
}
.loading-bar-fill {
  height: 100%; width: 0;
  background: var(--clr-primary);
  border-radius: 2px;
  animation: loadfill 2s ease forwards;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes loadfill { to { width: 100%; } }

/* ── Views ── */
.view { width: 100vw; height: 100vh; overflow: hidden; }
#view-auth { overflow-y: auto; }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
}
.topbar-logo {
  font-size: 1.2rem; font-weight: 800;
  letter-spacing: 2px; color: var(--clr-primary);
  flex-shrink: 0;
}
.topbar-stats { display: flex; gap: 10px; flex: 1; overflow-x: auto; }
.stat-badge {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: 20px; padding: 4px 12px;
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.char-name-display {
  font-size: 0.9rem; color: var(--clr-text-muted);
  font-weight: 600; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Auth View ── */
.auth-container {
  max-width: 420px; margin: 40px auto;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center; font-size: 1.8rem;
  font-weight: 800; color: var(--clr-primary);
  letter-spacing: 3px; margin-bottom: 28px;
}
.tab-bar {
  display: flex; gap: 2px;
  background: var(--clr-surface-2);
  border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 24px;
}
.tab-btn {
  flex: 1; padding: 8px;
  background: transparent; border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--clr-text-muted);
  font-size: 0.9rem; font-weight: 600;
  transition: all var(--transition);
}
.tab-btn.active {
  background: var(--clr-primary);
  color: #fff;
}

/* ── Fields ── */
.field-group { margin-bottom: 16px; }
.field-group label {
  display: block; font-size: 0.82rem;
  color: var(--clr-text-muted); font-weight: 600;
  margin-bottom: 6px; letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Game Layout ── */
.game-layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}
.panel {
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  overflow-y: auto; padding: 16px;
}
.panel-right { border-right: none; border-left: 1px solid var(--clr-border); }
.panel-center {
  background: var(--clr-bg); border: none; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Page / Section titles ── */
.page-content { max-width: 960px; margin: 0 auto; padding: 32px 20px; overflow-y: auto; height: calc(100vh - var(--topbar-h)); }
.page-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 24px; }

/* ── Character grid ── */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ── Modal ── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 32px; width: 90%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-box h3 {
  font-size: 1.3rem; font-weight: 800;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex; justify-content: flex-end;
  gap: 10px; margin-top: 20px;
}

/* ── Auth form enhancements ── */
.field-hint {
  font-size: 0.72rem;
  color: var(--clr-text-dim);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 4px;
}

/* Password strength bar */
.pw-strength {
  height: 3px;
  border-radius: 2px;
  margin-top: 6px;
  background: var(--clr-surface-3);
  overflow: hidden;
  transition: all 0.3s ease;
}
.pw-strength::after {
  content: '';
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
  width: var(--pw-w, 0%);
  background: var(--pw-color, var(--clr-text-dim));
}

/* Register status (success / error) */
.reg-status {
  margin-top: 14px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}
.reg-status.success {
  background: rgba(46,204,113,0.12);
  border: 1px solid var(--clr-success);
  color: var(--clr-success);
}
.reg-status.error {
  background: rgba(231,76,60,0.10);
  border: 1px solid var(--clr-danger);
  color: var(--clr-danger);
}
.reg-status-icon { font-size: 1.3rem; flex-shrink: 0; }
.reg-status-text { flex: 1; line-height: 1.4; }
.reg-status-bar  {
  height: 3px; background: var(--clr-surface-3);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.reg-status-bar-fill {
  height: 100%; background: var(--clr-success);
  border-radius: 2px;
  animation: countdown 3s linear forwards;
}
@keyframes countdown { from { width: 100%; } to { width: 0%; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.mc-clock-wrapper {
  position: relative;
  width: 160px;
  height: 90px;
  margin: 10px auto 20px auto;
}
/* Yarım Daire Maskesi */
.mc-clock-mask {
  width: 160px;
  height: 80px;
  overflow: hidden; 
  border-radius: 80px 80px 0 0;
  position: relative;
  border: 4px solid var(--clr-border);
  border-bottom: none;
  background-color: var(--clr-surface-0);
  box-shadow: inset 0px 4px 10px rgba(0,0,0,0.6);
}
/* İçeride Dönen Dev Gökyüzü Çemberi */
.mc-clock-sky {
  width: 160px;
  height: 160px; /* Tam Çember */
  border-radius: 50%;
  /* Gece, Şafak, Gündüz, Günbatımı renk geçişleri (Sonsuz döngü görünümü) */
  background: url('/static/assets/images/ui/minecraft_clock_sky_v2.png') no-repeat center center;
  background-size: cover; /* Resmi sığdırır */
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: center center;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1); /* Yumuşak dönüş */
}
/* Merkezdeki Ok */
.mc-clock-pointer {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 3px;
  height: 18px;
  background: #FFF;
  border-radius: 2px 2px 0 0;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 5px rgba(0,0,0,0.8);
}
.mc-clock-label {
  text-align: center;
  font-weight: 700;
  margin-top: 8px;
  color: var(--clr-text);
  font-size: 0.9rem;
}
/* Sağ panelin kapsayıcısını referans noktası yapıyoruz */
#right-panel {
  position: relative;
  overflow: hidden; 
}

/* Dikey saati en arkaya, transparan bir fon olarak atıyoruz */
#day-clock-container {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* İçeriklerin arkasında kalsın */
  opacity: 0.15; /* Transparanlık (istediğin gibi artırıp azalt) */
  pointer-events: none; /* Üzerine tıklanmasını engelle */
}

/* Aktivite kuyruğu gibi gerçek içerikler saatin önünde dursun */
.activities-container, 
#queue-panel {
  position: relative;
  z-index: 10;
}

/* "Zaman Akışı" ibaresini tamamen kaldırıyoruz */
#day-clock-container .clock-header,
#day-clock-container h2,
#day-clock-container h3,
.day-clock-title {
  display: none !important;
}
/* Mobil Cihazlar İçin Kusursuz Akış */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }
  .panel-left, .panel-right {
    width: 100% !important;
    max-width: 100% !important;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--clr-border);
    min-height: auto;
  }
  .panel-center {
    width: 100% !important;
    min-height: 80vh; /* Orta panel mobilde geniş alan kaplasın */
  }
  #venue-bottom-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px;
  }
  .vbb-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  /* Modal pencerelerini (Liderlik, İş vs.) mobilde tam ekrana yay */
  .modal-box {
    width: 95% !important;
    max-width: none !important;
    margin: 10px;
  }
}
/* Mac OS Dock Tarzı Mekan Navigasyonu */
#venue-bottom-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  z-index: 1000;
  transition: all 0.3s ease;
}

.dock-item {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--clr-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 2px solid transparent;
}

.dock-item:hover {
  transform: scale(1.3) translateY(-10px);
  z-index: 10;
  background: var(--clr-surface-2);
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.dock-item.active {
  transform: scale(1.2) translateY(-5px);
  border-color: var(--clr-primary);
  background: var(--clr-surface-2);
  /* Aktif olanı yarım daire efekti ile altını düzleştirme */
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 0 4px 15px rgba(var(--clr-primary-rgb), 0.4);
}