/*
 * 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.
 */

/* Navbar styles */
.navbar {
  background-color: #333;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar-logo:hover {
  color: #ddd;
}

.navbar-menu {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.navbar-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.navbar-link:hover {
  background-color: rgba(255,255,255,0.1);
  color: white;
}

/* Hamburger menu toggle button */
.navbar-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar-toggle-icon {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

/* Mobile styles */
@media (max-width: 768px) {
  .navbar-toggle {
    display: flex;
  }
  
  .navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    gap: 0;
  }
  
  .navbar-menu.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .navbar-link {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    text-align: left;
  }
  
  .navbar-link:hover {
    background-color: rgba(255,255,255,0.1);
  }
}

/* Main content */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.main-content {
  padding: 0 1rem 2rem 1rem;
  max-width: 1200px;
  margin: 2rem auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  min-height: calc(100vh - 200px);
}

.main-content h1 {
  color: #333;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 2px solid #007bff;
  padding-bottom: 0.5rem;
}

.main-content p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 1rem;
}

/* Unauthenticated layout styles */
.unauthenticated-body {
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.auth-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  margin: 1rem;
}

.auth-content {
  width: 100%;
}

/* Form styles for authentication pages */
.auth-content form {
  width: 100%;
}

.auth-content input[type="email"],
.auth-content input[type="password"],
.auth-content input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-content input[type="email"]:focus,
.auth-content input[type="password"]:focus,
.auth-content input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.auth-content input[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auth-content input[type="submit"]:hover {
  background-color: #0056b3;
}

.auth-content input[type="submit"]:active {
  background-color: #004085;
}

/* Flash messages */
.auth-content div[style*="color:red"] {
  color: #dc3545 !important;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.auth-content div[style*="color:green"] {
  color: #155724 !important;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}


/* Selection styles */
.selections-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.selections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.selection-card {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
}

.selection-card h3 {
  margin: 0 0 1rem 0;
}

.selection-card h3 a {
  color: #007bff;
  text-decoration: none;
}

.selection-card h3 a:hover {
  text-decoration: underline;
}

.selection-card p {
  margin: 0.5rem 0;
  color: #666;
}

.selection-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.selection-details .detail-group {
  margin-bottom: 1.5rem;
}

.selection-details label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.audio-files {
  display: grid;
  gap: 1rem;
}

.audio-file {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.audio-file h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.audio-file audio {
  width: 100%;
  margin: 0.5rem 0;
}

/* Form styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.form-group input[type="text"],
.form-group textarea,
.form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-group .form-text {
  color: #666;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.current-files {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
  color: white;
  text-decoration: none;
}

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

.btn-secondary:hover {
  background-color: #545b62;
  border-color: #545b62;
  color: white;
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  border-color: #007bff;
  color: #007bff;
}

.btn-outline:hover {
  background-color: #007bff;
  color: white;
  text-decoration: none;
}

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

.btn-danger:hover {
  background-color: #c82333;
  border-color: #c82333;
  color: white;
  text-decoration: none;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Alert styles */
.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert h4 {
  margin: 0 0 0.5rem 0;
}

.alert ul {
  margin: 0;
  padding-left: 1.5rem;
}


/* Enhanced audio file display */
.audio-player {
  margin-bottom: 1rem;
}

.audio-info {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.audio-basic-info {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

.audio-basic-info strong {
  display: block;
  color: #333;
  margin-bottom: 0.25rem;
}

.file-size {
  color: #666;
  font-size: 0.875rem;
}

.audio-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.audio-detail {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-weight: 600;
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.detail-value {
  color: #333;
  font-weight: 500;
}

.audio-analyzing {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
}

/* Quiz App Styles */
.game-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  margin: 0 auto;
}

.game-container .header {
  text-align: center;
  margin-bottom: 30px;
}

.game-container .header h1 {
  color: #2c3e50;
  font-size: 2.5em;
  margin-bottom: 10px;
  border: none;
  padding: 0;
}

.score-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.score-item {
  background: #f8f9fa;
  color: #666;
  padding: 10px 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e9ecef;
}

.score-item.question {
  background: #f8f9fa;
  color: #666;
}

.score-label {
  font-size: 0.8em;
  opacity: 0.7;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 1.3em;
  font-weight: 600;
}

.play-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.play-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #27ae60, #229954);
  border: none;
  color: white;
  font-size: 2em;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.play-button:active {
  transform: scale(0.95);
}

.play-button.playing {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.status-text {
  color: #7f8c8d;
  font-size: 1.1em;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #ecf0f1;
  border-radius: 4px;
  margin-bottom: 30px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  border-radius: 4px;
  transition: width 0.1s linear;
}

.answers-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 0;
}

.answer-button {
  background: white;
  border: 3px solid #e1e8ed;
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.answer-button:hover:not(:disabled) {
  background: linear-gradient(to right, #f8fbff, #ffffff);
  transform: translateX(8px) translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25);
  border-color: #3498db;
}

.answer-button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2), 0 6px 20px rgba(52, 152, 219, 0.25);
  border-color: #3498db;
}

.answer-button:not(:disabled) {
  animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

.answer-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: #f5f5f5;
}

.answer-button.correct {
  background: linear-gradient(135deg, #27ae60, #229954);
  color: white;
  border-color: #27ae60;
  border-width: 3px;
  transform: scale(1.02);
}

.answer-button.incorrect {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border-color: #e74c3c;
  border-width: 3px;
  transform: scale(0.98);
}

.answer-button.other {
  opacity: 0.4;
  transform: scale(0.95);
}

.composer-name {
  font-size: 1.35em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #0a0a0a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.selection-name {
  font-size: 1.3em;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 10px;
  line-height: 1.3;
}

.major-work-name {
  font-size: 1.25em;
  color: #2c4a6b;
  font-weight: 600;
  font-style: normal;
  line-height: 1.3;
}

.answer-button.correct .composer-name,
.answer-button.incorrect .composer-name {
  color: white;
}

.answer-button.correct .selection-name,
.answer-button.incorrect .selection-name {
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.answer-button.correct .major-work-name,
.answer-button.incorrect .major-work-name {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Legacy support for piece-title class */
.piece-title {
  font-size: 0.95em;
  color: #7f8c8d;
}

.answer-button.correct .piece-title,
.answer-button.incorrect .piece-title {
  color: rgba(255, 255, 255, 0.9);
}

.result-screen {
  text-align: center;
  padding: 40px;
}

.result-title {
  font-size: 2.5em;
  color: #2c3e50;
  margin-bottom: 20px;
}

.result-score {
  font-size: 3em;
  font-weight: bold;
  color: #3498db;
  margin-bottom: 10px;
}

.result-message {
  font-size: 1.3em;
  color: #7f8c8d;
  margin-bottom: 30px;
}

.button-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.button.primary {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.button.secondary {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
}

.button {
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile optimizations for quiz interface */
@media (max-width: 768px) {
  .game-container {
    padding: 15px;
    margin: 10px;
    border-radius: 15px;
  }

  .game-container .header {
    margin-bottom: 15px;
  }

  .game-container .header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
  }

  .score-bar {
    margin-bottom: 15px;
    gap: 10px;
  }

  .score-item {
    padding: 6px 12px;
    border-radius: 4px;
  }

  .score-label {
    font-size: 0.7em;
    margin-bottom: 1px;
  }

  .score-value {
    font-size: 1em;
  }

  .play-controls {
    margin-bottom: 15px;
  }

  .play-button {
    width: 50px;
    height: 50px;
    font-size: 1.3em;
  }

  .answers-section {
    gap: 10px;
  }

  .answer-button {
    padding: 20px;
    border-radius: 12px;
    border-width: 2px;
  }

  .answer-button .composer-name {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
  }

  .answer-button .selection-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
  }

  .answer-button .major-work-name {
    font-size: 1.05em;
    font-weight: 600;
    font-style: normal;
  }

  .answer-button .piece-title {
    font-size: 0.85em;
    line-height: 1.3;
    margin-top: 2px;
  }

  /* Reduce navbar padding on mobile */
  .navbar {
    padding: 0.75rem 0;
  }

  .navbar-logo {
    font-size: 1.3rem;
  }

  /* Reduce main content padding on mobile */
  .main-content {
    padding: 1rem;
    margin: 1rem auto;
  }

  .main-content h1 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
  }
}

/* SVG Icon Styles */
svg {
  display: inline-block;
  vertical-align: middle;
}

/* Quiz-specific icon styling */
.quiz-lobby h1 svg {
  color: #2c3e50;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Play button icon styling */
.play-button svg {
  color: white;
  transition: transform 0.2s ease;
}

.play-button:hover svg {
  transform: scale(1.1);
}

/* Icon alignment helpers */
.icon-with-text {
  display: flex;
  align-items: center;
  gap: 8px;
}
