/* Sanidad del Alma Herida, Inc. - Estilos */
:root {
  --primary: #8B0000;
  --primary-light: #C41E3A;
  --accent: #FF4D4D;
  --bg: #FFF8F5;
  --bg-section: #FFFFFF;
  --text: #2C2C2C;
  --text-light: #555;
  --gold: #D4AF37;
  --shadow: 0 4px 20px rgba(139, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Header */
header {
  background: linear-gradient(135deg, #8B0000 0%, #C41E3A 50%, #8B0000 100%);
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-area img, .logo-area svg {
  width: 60px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.logo-area h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.logo-area span {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Navegación */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

nav button {
  background: transparent;
  border: 2px solid transparent;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  font-family: inherit;
}

nav button:hover,
nav button.active {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

/* Main */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.section {
  display: none;
  animation: fadeIn 0.4s ease;
  background: var(--bg-section);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section h2 {
  color: var(--primary);
  font-size: 1.9rem;
  margin-bottom: 1.2rem;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.section h3 {
  color: var(--primary-light);
  margin: 1.5rem 0 0.8rem;
  font-size: 1.3rem;
}

/* Contenido editable */
.editable {
  outline: none;
  min-height: 1.5em;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.editable:hover {
  background: rgba(196, 30, 58, 0.05);
}

.editable:focus {
  background: rgba(196, 30, 58, 0.08);
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.25);
}

.edit-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Botones de acción */
.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  margin: 0.4rem 0.3rem 0.4rem 0;
  font-family: inherit;
}

.btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,0,0,0.3);
}

.btn-secondary {
  background: #555;
}

.btn-secondary:hover {
  background: #333;
}

.btn-gold {
  background: var(--gold);
  color: #333;
}

.btn-gold:hover {
  background: #E5C158;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  background: #FFF5F5;
  transition: var(--transition);
}

.upload-area:hover {
  border-color: var(--primary);
  background: #FFEEEE;
}

.upload-area input[type="file"] {
  display: none;
}

.upload-label {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  background: #f0f0f0;
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.preview-item .remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(139,0,0,0.85);
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* YouTube embeds */
.youtube-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1rem 0;
  align-items: center;
}

.youtube-form input {
  flex: 1;
  min-width: 220px;
  padding: 0.7rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.youtube-form input:focus {
  outline: none;
  border-color: var(--primary-light);
}

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

.video-item {
  background: #f9f9f9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-item iframe {
  width: 100%;
  height: 200px;
  border: none;
}

.video-item .video-title {
  padding: 0.8rem 1rem;
  font-weight: 600;
  color: var(--primary);
}

/* Testimonios / cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background: linear-gradient(145deg, #fff, #FFF5F5);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139,0,0,0.18);
}

.card .author {
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.8rem;
  font-size: 0.95rem;
}

/* Sanidad subsections */
.sanidad-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.sanidad-tabs button {
  background: #f0f0f0;
  border: 2px solid transparent;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition);
}

.sanidad-tabs button.active {
  background: var(--primary);
  color: white;
}

.sanidad-content {
  display: none;
}

.sanidad-content.active {
  display: block;
}

/* Libros */
.book-list {
  list-style: none;
}

.book-list li {
  background: #FFF5F5;
  margin-bottom: 1rem;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.book-list .book-title {
  font-weight: 700;
  color: var(--primary);
}

/* Footer */
footer {
  background: #2C2C2C;
  color: #ccc;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer p {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}

/* Toolbar de edición */
.edit-toolbar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 0.8rem 1.2rem;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  gap: 0.6rem;
  z-index: 999;
  align-items: center;
}

.edit-toolbar label {
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .logo-area {
    flex-direction: column;
  }
  
  nav {
    justify-content: center;
  }
  
  .logo-area h1 {
    font-size: 1.2rem;
  }
  
  main {
    padding: 1.2rem 1rem 3rem;
  }
  
  .section {
    padding: 1.5rem 1.2rem;
  }
  
  .edit-toolbar {
    bottom: 10px;
    right: 10px;
    left: 10px;
    justify-content: center;
  }
}

/* Mensaje de guardado */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: #2E7D32;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
