/**
 * apress — ArtistPress Theme
 * Replica fedele della grafica di ArtistPress
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600&display=swap');

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

:root {
  --black:      #0a0a0a;
  --white:      #f8f8f8;
  --gray-light: #e2e2e2;
  --gray-mid:   #999;
  --gray-dark:  #333;
  --gold:       #c9a84c;
  --gold-light: #e8c96d;
  --gold-dark:  #a07830;
  /* override dark theme vars */
  --primary-color: #0a0a0a;
  --text-color: #0a0a0a;
  --background-color: #f8f8f8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--black); text-decoration: none; }
a:hover { text-decoration: none; color: var(--black); }
ul { list-style: none; }
h1,h2,h3,h4,h5,h6 { margin-bottom: 0; line-height: 1.2; }
p { margin-bottom: 0; }
img { max-width: 100%; height: auto; }

/* ── Ticker ────────────────────────────────────────────────── */
.ap-ticker {
  background: var(--black);
  color: var(--white);
  padding: 0.55rem 0;
  overflow: hidden;
  white-space: nowrap;
}
.ap-ticker-inner {
  display: inline-flex;
  gap: 3rem;
  animation: apTicker 22s linear infinite;
}
.ap-ticker-item {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #aaa;
}
.ap-ticker-item span { color: var(--gold); }
@keyframes apTicker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Navigation ────────────────────────────────────────────── */
.main-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(248,248,248,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-light);
  box-shadow: none;
  padding: 0;
  margin-bottom: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 4rem;
  max-width: none;
  margin: 0;
}

/* Logo */
.ap-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.ap-logo-icon {
  width: 36px; height: 36px;
  background: var(--black);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.ap-logo-icon svg { width: 20px; height: 20px; fill: white; }
.ap-logo-icon img { width: 28px; height: 28px; object-fit: contain; }
.ap-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
}

.main-header h1 {
  margin-bottom: 0;
  font-size: 1rem;
}
.main-header h1 a {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--black); letter-spacing: -0.02em;
  text-decoration: none;
}

/* Nav links */
.main-nav ul { display: flex; align-items: center; gap: 2rem; }
.main-nav li { margin-left: 0; }
.main-nav a {
  text-decoration: none;
  color: var(--gray-dark);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.main-nav a:hover,
.main-nav a.active { color: var(--black); text-decoration: none; }

/* Nav CTA buttons */
.ap-nav-cta { display: flex; gap: 0.8rem; align-items: center; }

.btn-ghost {
  padding: 0.5rem 1.2rem;
  border: 1.5px solid var(--black);
  background: transparent;
  color: var(--black);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-ghost:hover { background: var(--black); color: var(--white); text-decoration: none; }

.btn-solid, .btn-primary, .btn {
  padding: 0.5rem 1.4rem;
  border: 1.5px solid var(--black);
  background: var(--black);
  color: var(--white) !important;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-solid:hover, .btn-primary:hover, .btn:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  text-decoration: none;
  color: var(--white);
}

.btn-secondary {
  padding: 0.5rem 1.4rem;
  border: 1.5px solid var(--black);
  background: transparent;
  color: var(--black) !important;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-secondary:hover { background: var(--black); color: var(--white) !important; }

.btn-danger {
  background: #c0392b;
  color: white !important;
  border-color: #c0392b;
  padding: 0.5rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-danger:hover { background: #a93226; border-color: #a93226; }

.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 0.95rem; }
.btn-xs { padding: 0.2rem 0.6rem; font-size: 0.72rem; }

/* ── Forms ─────────────────────────────────────────────────── */
input, select, textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-dark);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--gray-light);
  border-radius: 4px;
  background: #fff;
  color: var(--black);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
}
.form-group small { font-size: 0.78rem; color: var(--gray-mid); margin-top: 0.3rem; display: block; }

.required { color: var(--gold); }

.form-actions { margin-top: 1.5rem; }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 34px);
  padding: 2rem 1rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.auth-container h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--black);
}
.auth-container .auth-sub {
  font-size: 0.88rem;
  color: var(--gray-mid);
  margin-bottom: 1.8rem;
}
.auth-container .auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-mid);
  margin-top: 1.2rem;
}
.auth-container .auth-footer a { color: var(--black); font-weight: 600; }

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.dashboard-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 1.5rem;
}
.dashboard-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.3rem;
}
.dashboard-header p { font-size: 0.9rem; color: var(--gray-mid); }

/* Tabs */
.dashboard-tabs {}
.tabs-header {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-light);
  margin-bottom: 2rem;
  overflow-x: auto;
}
.tab {
  padding: 0.75rem 1.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-mid);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.tab:hover { color: var(--black); }
.tab.active {
  color: var(--black);
  border-bottom-color: var(--gold);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.tab-pane h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--gray-light);
}

/* Songs grid */
.songs-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.song-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #fff;
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.song-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  transform: translateY(-1px);
}

.song-icon img { width: 36px; height: 36px; opacity: 0.4; }

.song-details { flex: 1; min-width: 0; }
.song-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-artist { font-size: 0.82rem; color: var(--gray-mid); margin-bottom: 0.15rem; }
.song-date { font-size: 0.75rem; color: #bbb; }

.song-controls { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.song-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: #fafafa;
  border: 1.5px dashed var(--gray-light);
  border-radius: 10px;
}
.empty-state p { color: var(--gray-mid); margin-bottom: 1.2rem; font-size: 0.92rem; }

/* History table */
.history-table-container { overflow-x: auto; }
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.history-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-mid);
  border-bottom: 1.5px solid var(--gray-light);
}
.history-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-light);
  color: var(--black);
  vertical-align: middle;
}
.history-table tr:last-child td { border-bottom: none; }
.history-postcard-thumb {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--gray-light);
}

/* Inline form */
.inline-form { display: inline; }

/* Progress bar */
#progressBarFill { background-color: var(--gold) !important; }

/* ── Profile ─────────────────────────────────────────────────── */
.profile-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}
.profile-container h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.4rem;
}
.profile-container .profile-sub {
  font-size: 0.9rem;
  color: var(--gray-mid);
  margin-bottom: 2rem;
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.modal-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1.2rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
.main-footer {
  border-top: 1px solid var(--gray-light);
  padding: 1.5rem 4rem;
  background: var(--white) !important;
  margin-top: auto;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: 6px;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-danger,
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-content { padding: 1rem 1.5rem; }
  .main-nav { display: none; }
  .song-card { flex-wrap: wrap; }
  .song-controls { align-items: flex-start; width: 100%; }
}
