* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #c41e3a;
  --secondary: #ffffff;
  --background: #f5f5f5;
  --text: #333333;
  --light-gray: #e0e0e0;
  --border-radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  padding: 1rem;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 0;
  border-bottom: 3px solid var(--primary);
}

header h1 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

header p {
  font-size: 0.95rem;
  color: #666;
}

/* ===== LANDING PAGE ===== */
#landing-page {
  display: none;
}

#landing-page.active {
  display: block;
}

.tables-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.table-button {
  flex: 1 1 110px;
  max-width: 160px;
  background-color: var(--primary);
  color: var(--secondary);
  border: none;
  padding: 1.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-button:hover {
  background-color: #a01830;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.table-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-button.inactive {
  background-color: var(--light-gray);
  color: #999;
  cursor: not-allowed;
}

.table-button.inactive:hover {
  background-color: var(--light-gray);
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.songs-list {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--light-gray);
}

.songs-list h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.song-item {
  background-color: var(--secondary);
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.song-item:hover {
  background-color: #f9f9f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.song-item-title {
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.song-item-artist {
  font-size: 0.9rem;
  color: #666;
}

/* ===== SONG DETAIL PAGE ===== */
#song-detail {
  display: none;
}

#song-detail.active {
  display: block;
}

.song-header {
  background-color: var(--primary);
  color: var(--secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  text-align: center;
}

.song-header h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.song-header .artist {
  font-size: 1rem;
  opacity: 0.95;
}

.song-table-number {
  background-color: rgba(255, 255, 255, 0.2);
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.links-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.link-button {
  flex: 1;
  min-width: 140px;
  padding: 1rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.spotify-button {
  background-color: #1DB954;
  color: white;
}

.spotify-button:hover {
  background-color: #1ed760;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.youtube-button {
  background-color: #FF0000;
  color: white;
}

.youtube-button:hover {
  background-color: #cc0000;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.lyrics {
  background-color: var(--secondary);
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 1.5rem;
  font-family: 'Courier New', monospace;
}

.back-button {
  background-color: var(--light-gray);
  color: var(--text);
  border: none;
  padding: 1rem;
  border-radius: var(--border-radius);
  width: 100%;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-button:hover {
  background-color: #d0d0d0;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== ADMIN PANEL ===== */
#admin-panel {
  display: none;
}

#admin-panel.active {
  display: block;
}

.admin-container {
  max-width: 800px;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-tab-button {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem;
  border: 2px solid var(--primary);
  background-color: var(--secondary);
  color: var(--primary);
  border-radius: var(--border-radius);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-tab-button.active {
  background-color: var(--primary);
  color: var(--secondary);
}

.admin-form {
  display: none;
  background-color: var(--secondary);
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.admin-form.active {
  display: block;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
  min-height: 200px;
  font-family: 'Courier New', monospace;
}

.form-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.submit-button {
  flex: 1;
  min-width: 120px;
  padding: 1rem;
  background-color: var(--primary);
  color: var(--secondary);
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-button:hover {
  background-color: #a01830;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.delete-button {
  background-color: #ff4444;
  color: white;
}

.delete-button:hover {
  background-color: #cc0000;
}

.cancel-button {
  background-color: var(--light-gray);
  color: var(--text);
}

.cancel-button:hover {
  background-color: #d0d0d0;
}

.message {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  display: none;
}

.message.show {
  display: block;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.admin-access-button {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  border: none;
  color: rgba(0, 0, 0, 0.3);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-access-button:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

/* ===== OFFLINE INDICATOR ===== */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #ffc107;
  color: #333;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  display: none;
  z-index: 1000;
}

.offline-indicator.show {
  display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  body {
    padding: 0.75rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .table-button {
    padding: 1rem 0.5rem;
    font-size: 1rem;
    min-height: 80px;
  }

  .links-container {
    flex-direction: column;
  }

  .link-button {
    min-width: auto;
    width: 100%;
  }

  .admin-tabs {
    flex-direction: column;
  }

  .admin-tab-button {
    min-width: auto;
  }

  .form-buttons {
    flex-direction: column;
  }

  .submit-button {
    min-width: auto;
    width: 100%;
  }
}
