/* ESTILOS GENERALES */
:root {
  --color-primary: #2c3e50;
  --color-secondary: #3498db;
  --color-accent: #c0392b;
  --color-light: #ecf0f1;
  --color-dark: #34495e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* HEADER */
header {
  background: linear-gradient(to right, var(--color-accent), #000000);
  color: white;
  height: 90px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.logo-text img {
  height: 80px;
  width: auto;
  display: block;
  background: white;
  border-radius: 8px;
  padding: 4px;
}

.header-titles h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header-titles p {
  margin: 0;
  font-size: 1rem;
}

.contact {
  margin-left: auto;
  text-align: right;
}

/* BÚSQUEDA */
.search-section {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}

.search-form {
  display: flex;
  gap: 12px;
}

#search-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

#search-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}

#search-btn:hover {
  background: var(--color-secondary);
}

#search-message {
  margin-top: 1rem;
  min-height: 40px;
}

.not-found-message {
  display: flex;
  align-items: center;
  gap: 0.7em;
  background: #ffeaea;
  color: #c0392b;
  border-radius: 6px;
  padding: 0.7em 1em;
  font-size: 1.1em;
  box-shadow: 0 2px 8px rgba(192,57,43,0.08);
  margin-top: 0.5em;
}

/* RESULTADOS */
.results-layout {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

#results-container {
  flex: 2;
  min-width: 320px;
}

#detail-container {
  flex: 1;
  min-width: 280px;
  align-self: flex-start;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.table-container {
  max-height: 60vh;
  overflow-y: auto;
  position: relative;
}

.horizontal-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.horizontal-table th {
  background-color: var(--color-primary);
  color: white;
  padding: 12px 15px;
  text-align: left;
  position: sticky;
  top: 0;
}

.horizontal-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
}

.horizontal-table tr:hover {
  background-color: #f9f9f9;
}

.view-btn {
  background: linear-gradient(to right, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 3px 6px rgba(0,0,0,0.16);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.view-btn::before {
  content: "👁️";
  font-size: 1.1em;
}

/* DETALLE */
.detail-card {
  background: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.2);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  z-index: 20;
}

.vertical-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.vertical-table th {
  text-align: left;
  padding: 8px 12px;
  background: #f8f9fa;
  width: 40%;
  font-weight: bold;
  color: var(--color-dark);
}

.vertical-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}


/* RESPONSIVE */
@media (max-width: 900px) {
  .results-layout {
    flex-direction: column;
  }
  
  #results-container, #detail-container {
    min-width: 0;
    width: 100%;
  }
  
  #detail-container {
    position: static;
    margin-top: 2rem;
  }
  
  .header-content {
    flex-direction: column;
    height: auto;
    padding: 15px 0;
  }
  
  .contact {
    margin-left: 0;
    text-align: center;
    margin-top: 15px;
  }
}


/* Contenedores */
#results-container, #detail-container {
  transition: opacity 0.3s ease;
}

/* Botones */
.view-btn {
  background: #4CAF50;
  color: white;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.back-btn {
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 8px 15px;
  margin-bottom: 15px;
  cursor: pointer;
}


/* tables.css */
#detail-container {
  position: sticky;
  top: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.detail-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
}
