:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  line-height: 1.5;
  font-weight: 400;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: #213547;
  background-color: #ffffff;
}

.public-view {
  min-height: 100vh;
  background: #ffffff;
}

.public-header {
  background: white;
  padding: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 4px solid #ff462d;
}

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

.public-header h1 {
  margin: 0;
  font-size: 2.5rem;
  color: #333;
  font-weight: 700;
}

.public-header p {
  margin: 0.5rem 0 0;
  color: #555;
  font-size: 1.1rem;
}

.public-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.header-con-boton {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.libros-section h2 {
  color: #333;
  margin: 0;
  font-size: 1.8rem;
}

.btn-ofrecer-libro {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: #187E3F;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-ofrecer-libro:hover {
  background: #14632F;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 126, 63, 0.3);
}

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

.libro-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border-top: 4px solid #ff462d;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.libro-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(255, 70, 45, 0.2);
}

.libro-imagen {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: #f5f5f5;
}

.libro-imagen-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #999;
}

.libro-card h3 {
  margin: 0 0 0.5rem;
  color: #000;
  font-size: 1.4rem;
  font-weight: 700;
}

.libro-card .autor {
  color: #666;
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.libro-info {
  margin: 1rem 0;
}

.libro-card .propietario {
  color: #888;
  font-size: 0.85rem;
  margin: 0.5rem 0;
  font-style: italic;
}

.libro-card .notas {
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}

.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.badge.solicitado {
  background: #fff4e6;
  color: #ff462d;
}

.btn-solicitar {
  width: 100%;
  padding: 0.75rem;
  margin-top: auto;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: #29707A;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-solicitar:hover {
  background: #21545A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 112, 122, 0.3);
}

.libro-solicitado-info {
  margin-top: auto;
  padding: 0.75rem;
  background: #fff4e6;
  border-radius: 8px;
  border-left: 4px solid #ff462d;
}

.libro-solicitado-info p {
  margin: 0;
  color: #ff462d;
  font-weight: 500;
  font-size: 0.9rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f5f5f5;
  color: #ff462d;
  transform: rotate(90deg);
}

.formulario-solicitud {
  padding: 1rem;
}

.formulario-solicitud h2 {
  color: #333;
  margin-bottom: 1.5rem;
  text-align: center;
}

.libro-solicitud-info {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.libro-solicitud-info h3 {
  color: #333;
  margin: 0 0 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #29707A;
}

.instrucciones-solicitud {
  background: #e8f4ff;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #29707A;
}

.instrucciones-solicitud p {
  margin: 0.5rem 0;
  color: #333;
  font-size: 0.95rem;
}

.teams-contact {
  color: #29707A !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
}

.btn-confirmar-solicitud {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background: #29707A;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-confirmar-solicitud:hover {
  background: #21545A;
  transform: scale(1.02);
}

.alert {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 400px;
  max-width: 600px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.alert.alert-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

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

.alert-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-message {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
}

.alert-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 0;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.alert-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .public-header h1 {
    font-size: 1.8rem;
  }



  .libros-grid {
    grid-template-columns: 1fr;
  }

  .alert {
    min-width: 90%;
    max-width: 90%;
  }
}
