/**
 * Schul-Podcaster - Main Styles
 * Version 6.0
 */

:root {
  --primary-color: #1a237e;
  --accent-color: #4fc3f7;
  --bg-color: #f5f7fa;
  --text-dark: #333;
  --card-bg: #fff;
  --radius: 12px;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-dark);
}

/* === Landing Page === */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  box-sizing: border-box;
  
  /* Animated Mesh/Aurora Background */
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradient-float 15s ease infinite;
  position: relative;
  overflow: hidden;
}

/* Optional: Overlay pattern to make it look more professional */
.landing-container::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

@keyframes gradient-float {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.landing-header {
  text-align: center;
  margin-bottom: 3rem;
  z-index: 1; /* Ensure text is above background */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo-circle {
  width: 80px; height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 30px rgba(26, 35, 126, 0.2);
}
.logo-circle svg { width: 40px; height: 40px; color: #fff; }

.landing-header h1 { font-size: 2.5rem; margin: 0 0 0.5rem 0; color: var(--primary-color); }
.landing-header p { font-size: 1.1rem; color: #5c6bc0; margin: 0; }

.landing-options {
  display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center;
  width: 100%; max-width: 900px;
}

.option-card {
  flex: 1; min-width: 280px; max-width: 400px;
  background: var(--card-bg);
  padding: 2.5rem; border-radius: 20px;
  text-decoration: none; border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer; position: relative; overflow: hidden;
}

.option-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.card-icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
}
.card-icon svg { width: 32px; height: 32px; }

.listen-icon { background: #e0f2f1; color: #2e7d32; }
.create-icon { background: #e3f2fd; color: #1565c0; }

.card-content h2 { margin: 0 0 0.5rem 0; font-size: 1.25rem; color: var(--text-dark); }
.card-content p { margin: 0; color: #78909c; }

.card-arrow {
  margin-top: 2rem; font-size: 1.5rem; color: var(--primary-color); opacity: 0; transform: translateX(-10px); transition: all 0.3s;
}
.option-card:hover .card-arrow { opacity: 1; transform: translateX(0); }

.landing-footer { margin-top: 3rem; }
.link-btn { background: none; border: none; color: #9fa8da; cursor: pointer; font-size: 0.9rem; }
.link-btn:hover { color: var(--primary-color); text-decoration: underline; }

/* === Modals === */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  opacity: 0; transition: opacity 0.3s;
}
.modal.active { display: flex; opacity: 1; }

.modal-content {
  background: white; width: 90%; max-width: 400px; padding: 2rem; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-content.large { max-width: 800px; height: 80vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }

@keyframes popIn { from { transform: scale(0.9); } to { transform: scale(1); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.modal-content.large .modal-header { padding: 1.5rem; margin: 0; }
.modal-header h3 { margin: 0; font-size: 1.25rem; }
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; }

.modal-body { display: flex; flex-direction: column; gap: 1rem; }
.modal-content.large .modal-body { padding: 1.5rem; overflow-y: auto; }

.input-field {
  padding: 1rem; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 1rem; transition: border-color 0.2s; width: 100%; box-sizing: border-box;
}
.input-field:focus { outline: none; border-color: var(--primary-color); }

/* Password Toggle Styles */
.password-wrapper {
  position: relative;
  width: 100%;
}
.password-wrapper .input-field {
  padding-right: 40px; /* Space for the eye icon */
}
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #999;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-password:hover {
  color: var(--primary-color);
}
.toggle-password svg {
  width: 20px;
  height: 20px;
}

.full-width { width: 100%; }
.error-text { color: #d32f2f; font-size: 0.9rem; margin: 0; text-align: center; }

/* === Auth Screen (Listen Mode) === */
.auth-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #e8eaf6; padding: 1rem;
}
.auth-card {
  background: white; padding: 3rem 2rem; border-radius: 24px; text-align: center; max-width: 400px; width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}
.icon-circle {
  width: 64px; height: 64px; background: #e0f2f1; color: #00695c; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
}
.icon-circle svg { width: 32px; height: 32px; }
.input-field-large {
  width: 100%; padding: 1rem; font-size: 1.2rem; text-align: center; letter-spacing: 0.2rem;
  border: 2px solid #e0e0e0; border-radius: 12px; margin: 1.5rem 0;
}
.back-link { display: block; margin-top: 1.5rem; color: #999; text-decoration: none; font-size: 0.9rem; }

/* === Admin Dashboard === */
.fullscreen-overlay {
  position: fixed; inset: 0; background: #f5f7fa; z-index: 2000; overflow-y: auto;
}
.admin-container { max-width: 1000px; margin: 0 auto; padding: 2rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }

.admin-card {
  background: white; padding: 1.5rem; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.admin-card.full-width { grid-column: 1 / -1; }
.admin-card h3 { margin-top: 0; color: var(--primary-color); border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }

.admin-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 400px; overflow-y: auto; }
.admin-list-item {
  display: flex; justify-content: space-between; align-items: center; padding: 1rem;
  background: #f9fafb; border-radius: 8px; border: 1px solid #eee;
}
.admin-list-item .info { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-list-item .badge { font-size: 0.8rem; background: #e8eaf6; color: var(--primary-color); padding: 2px 6px; border-radius: 4px; display: inline-block; width: fit-content; }

.settings-form, .create-group-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group label { font-size: 0.9rem; font-weight: 600; color: #555; }

/* === Listen Mode (Group Select) === */
.group-select-list { display: grid; gap: 1rem; }
.group-item {
  background: white; border: 1px solid #eee; padding: 1rem; border-radius: 12px;
  display: flex; align-items: center; gap: 1rem; cursor: pointer; text-align: left;
  transition: all 0.2s; width: 100%;
}
.group-item:hover { border-color: var(--primary-color); transform: translateX(5px); }
.group-icon { width: 40px; height: 40px; background: #e3f2fd; color: var(--primary-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.group-icon svg { width: 20px; height: 20px; }
.group-item span { font-weight: 600; flex: 1; }
.group-item .arrow { flex: 0; color: #ccc; }

.recordings-list-simple { display: flex; flex-direction: column; gap: 1rem; }
.recording-item { background: white; padding: 1rem; border-radius: 12px; border: 1px solid #eee; }
.rec-info { margin-bottom: 0.5rem; }
.rec-info h4 { margin: 0 0 0.25rem 0; }
.rec-meta { font-size: 0.8rem; color: #888; }
.btn-download { display: inline-block; margin-top: 0.5rem; font-size: 0.8rem; color: var(--primary-color); text-decoration: none; }

.empty-state-large {
  display: flex; align-items: center; justify-content: center; height: 100%;
  background: #fff; border-radius: 20px; border: 2px dashed #eee; color: #999;
}

/* === Responsive === */
@media (max-width: 600px) {
  .landing-options { flex-direction: column; }
  .option-card { width: 100%; max-width: none; }
  .admin-list-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .admin-list-item .actions { width: 100%; display: flex; gap: 0.5rem; }
  .admin-list-item .actions button { flex: 1; }
}