:root {
  --primary-color: #6200ea;
  --secondary-color: #03dac6;
  --background-dark: #121212;
  --background-light: #f5f5f5;
  --text-dark: #121212;
  --text-light: #ffffff;
  --card-dark: #1e1e1e;
  --card-light: #ffffff;
  --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.1);
  --accent-color: #bb86fc;
  --error-color: #cf6679;
  --success-color: #03dac6;
  --border-radius: 12px;
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  background-color: var(--background-light);
  color: var(--text-dark);
  line-height: 1.6;
}

body.dark-mode {
  background-color: var(--background-dark);
  color: var(--text-light);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 30px;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-container img {
  max-height: 60px;
  margin-right: 15px;
}

.header-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.dark-mode .header-title {
  color: var(--accent-color);
}

.header-actions {
  display: flex;
  gap: 15px;
}

.btn {
  padding: 10px 20px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-speed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #7c4dff;
  box-shadow: 0 4px 12px rgba(98, 0, 234, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.dark-mode .btn-secondary {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.btn-secondary:hover {
  background-color: rgba(98, 0, 234, 0.1);
}

.dark-mode .btn-secondary:hover {
  background-color: rgba(187, 134, 252, 0.1);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode .theme-toggle {
  color: var(--text-light);
}

/* Main Content Styles */
.card {
  background-color: var(--card-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  margin-bottom: 30px;
  overflow: hidden;
  transition: all var(--transition-speed);
}

.dark-mode .card {
  background-color: var(--card-dark);
  box-shadow: var(--shadow-dark);
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark-mode .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.dark-mode .card-title {
  color: var(--accent-color);
}

.card-body {
  padding: 20px;
}

/* Gallery Styles */
.gallery-container {
  position: relative;
  margin-bottom: 30px;
}

.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 15px;
  padding: 10px 0;
}

.gallery::-webkit-scrollbar {
  height: 8px;
}

.gallery::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.gallery::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

.dark-mode .gallery::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .gallery::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
}

.gallery-item {
  flex: 0 0 auto;
  width: 300px;
  height: 200px;
  scroll-snap-align: start;
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  border: none;
  font-size: 1.2rem;
  color: var(--primary-color);
  transition: all var(--transition-speed);
}

.dark-mode .gallery-nav {
  background-color: rgba(30, 30, 30, 0.8);
  color: var(--accent-color);
}

.gallery-nav:hover {
  background-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.dark-mode .gallery-nav:hover {
  background-color: var(--card-dark);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.gallery-prev {
  left: 10px;
}

.gallery-next {
  right: 10px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  overflow: hidden;
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.modal-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

/* Video Container Styles */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  margin-bottom: 30px;
  border-radius: var(--border-radius);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Description Styles */
.description {
  margin-bottom: 30px;
  line-height: 1.8;
}

/* Technical Sheet Styles */
.tech-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.tech-item {
  display: flex;
  flex-direction: column;
}

.tech-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.dark-mode .tech-label {
  color: var(--accent-color);
}

.tech-value {
  font-size: 1.1rem;
}

/* Edit Mode Styles */
.edit-mode {
  display: none;
}

.edit-mode.active {
  display: block;
}

.edit-form {
  margin-top: 30px;
}

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

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

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color var(--transition-speed);
  background-color: white;
  color: var(--text-dark);
}

.dark-mode .form-control {
  background-color: #2d2d2d;
  border-color: #444;
  color: var(--text-light);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(98, 0, 234, 0.2);
}

.dark-mode .form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.2);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

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

/* Login Form Styles */
.login-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 30px;
  background-color: var(--card-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
}

.dark-mode .login-form {
  background-color: var(--card-dark);
  box-shadow: var(--shadow-dark);
}

.login-title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.dark-mode .login-title {
  color: var(--accent-color);
}

/* Footer Styles */
footer {
  margin-top: 50px;
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* WhatsApp Button */
.whatsapp-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transition: all var(--transition-speed);
  text-decoration: none;
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    margin-top: 15px;
    width: 100%;
    justify-content: space-between;
  }
  
  .gallery-item {
    width: 250px;
    height: 180px;
  }
  
  .tech-sheet {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .gallery-item {
    width: 200px;
    height: 150px;
  }
  
  .btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
  
  .header-title {
    font-size: 1.5rem;
  }
}

/* Animation Effects */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* Stars background for galactic theme */
.stars-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.dark-mode .stars-background {
  opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

.dark-mode ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode ::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: var(--border-radius);
  color: white;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s ease;
}

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

.toast-success {
  background-color: var(--success-color);
}

.toast-error {
  background-color: var(--error-color);
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin: 20px auto;
}

.dark-mode .spinner {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-color);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  width: auto;
  height: auto;
}

/* Mejoras para dispositivos móviles */
@media (max-width: 576px) {
  .container {
    padding: 10px;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    margin-top: 15px;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .gallery-item {
    width: 100%;
    height: 180px;
  }
  
  .modal-content {
    width: 90%;
    height: auto;
  }
  
  .modal-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
  }
  
  .ficha-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn {
    width: 100%;
  }
}

