/* ============================================================
   Musical Bingo – Main Stylesheet
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-primary: #1db954;
  --color-primary-dark: #17a349;
  --color-secondary: #333;
  --color-muted: #888;
  --color-border: #e0e0e0;
  --color-error: #e53935;
  --color-empty-cell: #e0e0e0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  font-family: var(--font);
  font-size: 16px;
  background: var(--color-bg);
  color: var(--color-secondary);
  line-height: 1.5;
}

/* ---------- Layout ---------- */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header {
  margin-bottom: 2.5rem;
}

/* Flex row: logo on the left, text on the right */
.header-brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.header-logo {
  height: 56px;
  width: auto;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: contain;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.header-org {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary-dark);
}

header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #111;
  line-height: 1.15;
}

header .subtitle {
  margin-top: 0.2rem;
  color: var(--color-muted);
  font-size: 0.88rem;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

footer {
  text-align: center;
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-brand {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-secondary);
  opacity: 0.6;
}

.footer-privacy {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* ---------- Cards (sections) ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.75rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
}

/* ---------- Exportify Instructions ---------- */
.exportify-instructions {
  background: rgba(29, 185, 84, 0.05);
  border: 1px solid rgba(29, 185, 84, 0.2);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--color-secondary);
}

.exportify-instructions p {
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.exportify-instructions ol {
  padding-left: 1.3rem;
  margin-bottom: 0.9rem;
  line-height: 1.8;
}

.exportify-instructions a {
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 500;
}

.exportify-instructions a:hover {
  text-decoration: underline;
}

.btn-exportify {
  background: var(--color-primary);
  color: #fff;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}

.btn-exportify:hover {
  background: var(--color-primary-dark);
  text-decoration: none !important;
}

.btn-exportify:active {
  transform: scale(0.97);
}

/* ---------- Drop Zone ---------- */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-primary);
  background: rgba(29, 185, 84, 0.04);
}

.drop-icon {
  width: 48px;
  height: 48px;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.drop-label {
  font-size: 1rem;
  color: var(--color-secondary);
}

.drop-sub {
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ---------- CSV Status ---------- */
.csv-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.csv-status.success {
  background: rgba(29, 185, 84, 0.1);
  color: #166534;
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.csv-status.error {
  background: rgba(229, 57, 53, 0.08);
  color: var(--color-error);
  border: 1px solid rgba(229, 57, 53, 0.25);
}

/* ---------- Song Preview ---------- */
.song-preview {
  margin-top: 1rem;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.song-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.song-preview thead th {
  background: var(--color-bg);
  padding: 0.4rem 0.75rem;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  color: var(--color-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.song-preview tbody tr:nth-child(even) {
  background: var(--color-bg);
}

.song-preview tbody td {
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--color-border);
  color: #333;
}

.song-preview tbody td.artist {
  color: var(--color-muted);
}

/* ---------- Options ---------- */
.option-group {
  margin-bottom: 1.25rem;
}

.option-group:last-child {
  margin-bottom: 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
}

.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.sub-option {
  margin-top: 0.75rem;
  padding-left: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sub-option label {
  font-size: 0.9rem;
  color: var(--color-secondary);
}

.number-input {
  width: 90px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.number-input:focus {
  border-color: var(--color-primary);
}

.hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
}

.file-name-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-style: italic;
}

/* ---------- Logo option row ---------- */
/* Side-by-side layout: controls on left, live preview on right */
.logo-option-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.logo-option-controls {
  flex: 1;
  min-width: 0;
}

/* ---------- Logo preview ---------- */
.logo-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.logo-preview-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted);
}

.logo-preview-wrap img {
  height: 56px;
  width: auto;
  max-width: 120px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  object-fit: contain;
  background: #fafafa;
  padding: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
}

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

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

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

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

.btn-secondary.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* ---------- Progress ---------- */
.progress-wrap {
  margin-top: 1.25rem;
}

.progress-bar-bg {
  background: var(--color-border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-label {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  text-align: center;
}

/* ---------- Error message ---------- */
.error-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(229, 57, 53, 0.08);
  color: var(--color-error);
  border: 1px solid rgba(229, 57, 53, 0.25);
  border-radius: 8px;
  font-size: 0.88rem;
}

/* ---------- Utilities ---------- */
.hidden {
  display: none !important;
}
