/* BandSync — Modern Sahne, Grup, Setlist ve Repertuvar Arayüz Stilleri */
:root,
[data-theme="dark"] {
  --bg: #14161c;
  --bg-elevated: #1c1f28;
  --bg-card: #222632;
  --bg-hover: #2a2f3e;
  --border: #313748;
  --text: #f3f4f7;
  --text-muted: #9ba3b5;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --emerald: #10b981;
  --amber: #f59e0b;
  --danger: #ef4444;
  --chord-color: #60a5fa;
  --section-active-bg: rgba(59, 130, 246, 0.14);
  --section-active-border: #3b82f6;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f3f4f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef0f5;
  --border: #dce0e8;
  --text: #14161c;
  --text-muted: #5e6678;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --emerald: #059669;
  --amber: #d97706;
  --danger: #dc2626;
  --chord-color: #1d4ed8;
  --section-active-bg: rgba(37, 99, 235, 0.08);
  --section-active-border: #2563eb;
  --shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: inherit;
}

/* Auth & Install Shell */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--emerald));
  box-shadow: 0 0 12px var(--primary);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.user-pill {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.mode-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Main Container */
.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 1.25rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Dashboard Cards */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dash-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--bg-hover);
}

.dash-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(59, 130, 246, 0.14);
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.dash-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.dash-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Cards & Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Two-Column Group Layout */
.two-col-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.15rem;
  align-items: start;
}

@media (max-width: 900px) {
  .two-col-grid {
    grid-template-columns: 1fr;
  }
}

/* Inputs & Buttons */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
}

.textarea-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  min-height: 320px;
  white-space: pre;
  overflow-x: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

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

.btn-sm {
  padding: 0.32rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

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

.btn-emerald {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #ffffff;
}

/* Pills & Filter Tabs */
.pill-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.pill.active-emerald {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--emerald);
  color: var(--emerald);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
}

.badge-leader {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--amber);
}

.badge-musician {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--chord-color);
}

/* Song & Member List Rows */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.item-row:hover {
  border-color: var(--text-muted);
}

.item-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.item-title {
  font-weight: 700;
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Song Viewer & Chord/Lyric Display */
.song-sheet {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: var(--sheet-scale, 1rem);
}

.song-section-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.05rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.song-section-card.is-live-active {
  border-color: var(--section-active-border);
  background: var(--section-active-bg);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.song-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border);
}

.song-section-title {
  font-size: 0.85em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber);
}

.song-line-pair, .song-line-chords, .song-line-lyrics {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0.4rem;
}

.chord-line-text {
  color: var(--chord-color);
  font-weight: 700;
  font-size: 0.96em;
  line-height: 1.3;
  user-select: none;
}

.lyric-line-text {
  color: var(--text);
  font-size: 1.02em;
  line-height: 1.45;
}

.song-line-spacer {
  height: 0.65rem;
}

/* Live Stage Control Deck */
.live-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.live-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.live-deck {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
}

.live-deck-grid {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
  align-items: center;
}

.deck-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}

.bpm-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--emerald);
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s ease, background 0.12s ease;
}

.bpm-circle:hover {
  transform: scale(1.05);
  background: rgba(16, 185, 129, 0.24);
}

.bpm-circle.pulsing {
  animation: bpmPulse 0.5s infinite alternate;
}

@keyframes bpmPulse {
  from { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  to { transform: scale(1.1); box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

/* Signal Buttons & Fullscreen Overlay */
.signal-grid {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.signal-btn {
  padding: 0.45rem 0.8rem;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.84rem;
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.signal-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.signal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  padding: 2rem;
  cursor: pointer;
  animation: signalPop 0.22s ease-out;
}

.signal-overlay h1 {
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.signal-overlay p {
  margin-top: 0.75rem;
  font-size: 1.1rem;
  opacity: 0.9;
}

@keyframes signalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Helpers */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.row-inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

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

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.65rem 0;
}

.alert-box {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
