/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

/* Container styles */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Header styles */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #dee2e6;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #dee2e6;
}

.header h1, .admin-header h1 {
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 300;
}

.admin-link {
  color: #6c757d;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  transition: all 0.2s;
}

.admin-link:hover {
  color: #495057;
  border-color: #adb5bd;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 10px 20px;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* Category sections */
.category-section {
  margin-bottom: 50px;
}

.category-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
  display: inline-block;
}

/* Songs grid */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.song-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.song-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.song-image {
  height: 200px;
  overflow: hidden;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-image {
  font-size: 4rem;
  color: #dee2e6;
}

.song-info {
  padding: 20px;
}

.song-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: #2c3e50;
}

.song-category {
  display: inline-block;
  background-color: #007bff;
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.song-description {
  color: #6c757d;
  margin-bottom: 15px;
  font-size: 14px;
}

.audio-controls {
  margin-top: 15px;
}

.audio-player {
  width: 100%;
}

.no-audio {
  color: #dc3545;
  font-style: italic;
  font-size: 14px;
}

/* Admin table styles */
.songs-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.table-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.placeholder-image-small {
  width: 50px;
  height: 50px;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #dee2e6;
  font-size: 1.5rem;
}

.song-actions-cell {
  white-space: nowrap;
}

.song-actions-cell .btn {
  margin-right: 5px;
}

.song-actions-cell form {
  display: inline-block;
  margin: 0;
}

.song-actions-cell form input[type="submit"] {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.audio-status {
  color: #28a745;
  font-weight: 500;
}

.no-audio-status {
  color: #dc3545;
  font-weight: 500;
}

/* Form styles */
.form-container {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.song-form .form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
}

.form-input, .form-textarea, .form-file, .form-select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-file:focus, .form-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-help {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 14px;
}

.current-image, .current-audio {
  margin-bottom: 15px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.preview-image {
  max-width: 200px;
  height: auto;
  border-radius: 4px;
  margin-top: 10px;
}

.preview-audio {
  width: 100%;
  margin-top: 10px;
}

.extracted-image-preview {
  margin: 15px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 4px;
  text-align: center;
}

.extracted-image-preview img {
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.extracted-image-preview p {
  text-align: center;
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.error-messages {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 25px;
}

.error-messages h4 {
  margin-bottom: 10px;
}

.error-messages ul {
  margin-left: 20px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state h2 {
  margin-bottom: 15px;
  color: #495057;
}

.empty-state p {
  margin-bottom: 25px;
  font-size: 16px;
}

/* Login page styles */
.login-container {
  max-width: 400px;
  margin: 80px auto;
  padding: 20px;
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-title {
  color: #2c3e50;
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 8px;
  text-align: center;
}

.login-subtitle {
  color: #6c757d;
  margin-bottom: 30px;
  font-size: 14px;
  text-align: center;
}

.login-form {
  margin-top: 20px;
}

.login-form-group {
  margin-bottom: 20px;
}

.login-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.login-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.login-button {
  width: 100%;
  padding: 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 20px;
}

.login-button:hover {
  background-color: #0056b3;
}

.forgot-password {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
  display: block;
  text-align: center;
  transition: color 0.2s;
}

.forgot-password:hover {
  color: #0056b3;
  text-decoration: underline;
}

.flash-messages {
  margin-bottom: 20px;
}

.flash-alert {
  background-color: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
  font-size: 14px;
  margin-bottom: 10px;
}

.flash-notice {
  background-color: #d1edff;
  color: #0c5460;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #bee5eb;
  font-size: 14px;
  margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
  .container, .admin-container {
    padding: 15px;
  }
  
  .header, .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .songs-grid {
    grid-template-columns: 1fr;
  }
  
  .table {
    font-size: 14px;
  }
  
  .table th, .table td {
    padding: 10px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .login-container {
    margin: 40px auto;
    padding: 15px;
  }
  
  .login-card {
    padding: 30px 20px;
  }
  
  .login-title {
    font-size: 1.75rem;
  }
}
