:root {
  /* Paleta de colores */
  --color-primary: #008080;
  --color-primary-dark: #006666;
  --color-primary-light: #00a3a3;
  --color-text: #333;
  --color-text-light: #777;
  --color-bg: #f9f9f9;
  --color-card: #fff;
  --color-border: #e0e0e0;
  --color-error: #d9534f;
  --color-warning: #f0ad4e;
  --color-success: #5cb85c;
  --border-radius: 8px;
}

/* Reset y estilos base */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}

/* Encabezados */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  font-weight: 600;
}

h1 {
  color: var(--color-primary);
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

/* Enlaces */
a, .link {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover, .link:hover {
  text-decoration: underline;
}

/* Botones principales */
.button, .button:visited {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  width: auto;
  min-width: 180px;
  margin: 5px 0;
}

.button:hover {
  background-color: var(--color-primary-dark);
}

/* Botones específicos (Nuevo ticket / Ver estado) */
#new_ticket, #check_status {
  background: none !important;
  border: none !important;
  padding-left: 0 !important;
  margin-top: 20px !important;
}

/* Formularios */
input, textarea, select {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 10px;
  width: 100%;
  max-width: 600px;
  font-family: inherit;
  font-size: inherit;
}

input:focus, textarea:focus {
  border-color: var(--color-primary);
  outline: none;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

/* Contenedor principal */
#container {
  background: var(--color-card);
  width: 90%;
  max-width: 1200px;
  margin: 20px auto;
  border-radius: var(--border-radius);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  overflow: hidden; /* Evita fugas de bordes redondeados */
}

#header {
  display: flex;
  flex-direction: row-reverse; /* Invierte el orden de los elementos hijos */
  align-items: center;
  justify-content: space-between; /* Mantiene el espacio entre ellos */
  padding: 20px;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
}

#logo img {
  max-height: 60px;
  height: auto;
  display: block;
}

/* Navegación */
#nav {
  background: var(--color-primary);
  padding: 12px 20px;
  margin: 0;
}

#nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#nav li {
  display: inline-block;
  margin-right: 10px;
}

#nav li a {
  color: white;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  display: block;
}

#nav li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Contenido */
#content {
  padding: 20px;
}

/* Landing Page (Botones principales) */
#landing_page {
  text-align: left;
}

#landing_page .button {
  display: inline-block;
  margin: 10px;
}

/* Mensajes de alerta */
.alert {
  padding: 10px 15px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
}

.alert.notice {
  background-color: #e8f5e9;
  border: 1px solid var(--color-success);
}

.alert.warning {
  background-color: #fff8e1;
  border: 1px solid var(--color-warning);
}

.alert.error {
  background-color: #ffebee;
  border: 1px solid var(--color-error);
}

/* Footer */
#footer {
  text-align: center;
  padding: 15px;
  border-top: 1px solid var(--color-border);
  font-size: 14px;
  color: var(--color-text-light);
  background: var(--color-card);
}

/* Responsive para móviles */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  #container {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #header {
    flex-direction: column;
    padding: 15px;
  }

  #logo img {
    margin-bottom: 10px;
  }

  #nav li {
    display: block;
    margin: 5px 0;
  }
  .button-group {
    order: 1; /* Fuerza los botones después */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Espacio entre botones */
  }
    .welcome-text {
    order: 2; /* Fuerza el texto a aparecer primero */
    padding: 0 15px; /* Margen lateral para móvil */
  }
    #landing_page {
    display: flex;
    flex-direction: column; /* Apila elementos verticalmente */
    gap: 20px; /* Espacio entre texto y botones */
  }
  #landing_page .button {
    width: 90%; /* Botones casi del ancho de pantalla */
    display: block;
    margin: 10px auto; /* Centrado horizontal */
    padding: 15px 0; /* Más área táctil */
    font-size: 18px; /* Texto más grande */
  }
    /* Ajuste para el texto de bienvenida */
  #content p {
    padding: 0 15px;
    text-align: justify;
  }
  /* Espaciado entre elementos */
  .button + .button {
    margin-top: 15px;
  }
}
/* Aplica los mismos estilos a todos los inputs relevantes */
input[type="text"],
input[type="email"],
input[type="password"] {  /* ¡Añade esta línea! */
  width: 80%; 
  display: inline-block;
}

/* Estilo para el enlace "Soy un agente" */
a {
  display: inline-block;
  margin-left: 10px;
}
/* Estilo de tablas leo zamora */
/* Estilo mejorado para la tabla de tickets - Versión Premium */
#ticketTable {
    width: 100%;
    max-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
    margin: 25px 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border: 1px solid #e0e3e6;
}

#ticketTable caption {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    padding: 18px 20px 12px;
    text-align: left;
    background: #f8fafc;
    border-bottom: 1px solid #eaeff5;
}

#ticketTable thead {
    background: #008080; /* Color sólido azul */
}

#ticketTable th {
    padding: 16px 18px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 0.82em;
    letter-spacing: 0.8px;
    text-align: left;
    vertical-align: middle;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#ticketTable th:last-child {
    border-right: none;
}

#ticketTable th a {
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ticketTable th a:hover {
    opacity: 0.9;
}

#ticketTable td {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f3f7;
    vertical-align: middle;
    color: #4a5568;
    font-size: 0.95em;
    text-align: left;
    position: relative;
}

#ticketTable tr:nth-child(even) {
    background-color: #f9fbfd;
}

#ticketTable tbody tr:last-child td {
    border-bottom: none;
}

#ticketTable tbody tr:hover {
    background-color: #f1f5fd;
}

#ticketTable a:not(.Icon) {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.25s ease;
}

#ticketTable a:not(.Icon):hover {
    color: #2a5bd7;
    text-decoration: underline;
}

#ticketTable .Icon.webTicket {
    position: relative;
    padding-left: 28px;
    font-weight: 600;
    color: #2d3748;
}

#ticketTable .Icon.webTicket:before {
    content: "✉";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
    color: #4a6ee0;
}

#ticketTable .truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
}

/* Bordes redondeados específicos */
#ticketTable thead tr:first-child th:first-child {
    border-top-left-radius: 13px;
}

#ticketTable thead tr:first-child th:last-child {
    border-top-right-radius: 13px;
}

#ticketTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 13px;
}

#ticketTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 13px;
}

/* Estilos para estados */
#ticketTable td:nth-child(3) { /* Columna Estado */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

#ticketTable td:nth-child(3):contains("Cerrado") {
    color: #27ae60;
    background-color: rgba(39, 174, 96, 0.08);
    border-radius: 4px;
    padding: 4px 8px;
    display: inline-block;
}

/* Alineación mejorada para columnas específicas */
#ticketTable td:nth-child(1), /* Ticket # */
#ticketTable td:nth-child(2), /* Fecha */
#ticketTable td:nth-child(5) { /* Departamento */
    white-space: nowrap;
    width: 1%;
}

/* Efectos visuales avanzados */
#ticketTable tbody tr {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#ticketTable tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Separador visual entre filas */
#ticketTable td {
    border-bottom: 1px solid #edf2f7;
}

#ticketTable tr:last-child td {
    border-bottom: none;
}
/* Scroll mejor visibilidad para dispositivos moviles opción 1*/
@media (max-width: 768px) {
    #ticketTable {
        border: none;
        box-shadow: none;
    }
    
    #ticketTable caption {
        background: transparent;
        border: none;
        padding: 10px;
    }
    
    #ticketTable thead {
        display: none;
    }
    
    #ticketTable tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e3e6;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    #ticketTable td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid #f0f3f7;
        text-align: right;
        white-space: normal;
    }
    
    #ticketTable td:last-child {
        border-bottom: none;
    }
    
    #ticketTable td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2c3e50;
        margin-right: 15px;
        text-align: left;
    }
    
    /* Añade esto en tu HTML o con JavaScript: */
    /* <td data-label="Asunto">Prueba caída de sitio web</td> */
}
#ticketThread {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.thread-entry {
    position: relative;
    margin-bottom: 25px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.thread-entry .header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.thread-entry .header b {
    font-size: 1.2em;
    color: #2c3e50;
}

.thread-entry time {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-left: 10px;
}

.thread-entry .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.thread-entry.message .avatar {
    float: left;
    margin-right: 15px;
}

.thread-entry.response .avatar {
    float: right;
    margin-left: 15px;
}

.thread-body {
    padding: 10px 0;
    font-size: 1em;
    line-height: 1.6;
    color: #34495e;
}

.thread-body blockquote {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 12px 15px;
    margin: 15px 0;
    font-style: italic;
}

.thread-event {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 20px 0;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #95a5a6;
}

.thread-event .type-icon {
    margin-right: 12px;
    font-size: 1.3em;
    color: #7f8c8d;
}

.thread-event .description {
    flex: 1;
    font-size: 0.95em;
}

.thread-event .description b {
    font-weight: 600;
    color: #2c3e50;
}

.thread-event .description img.avatar {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 50%;
}
/* Ahora que el texto no se vea desordenado al entrar a los tickets cerrados en el movil*/
/* Estilos responsive para el hilo de tickets en móviles */
@media (max-width: 768px) {
    #ticketThread {
        padding: 10px;
    }
    
    .thread-entry {
        border: 1px solid #e0e3e6;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 12px;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    .thread-entry .header {
        display: flex;
        flex-direction: column;
        margin-bottom: 10px;
    }
    
    .thread-entry .header b {
        font-size: 1.1em;
        margin-bottom: 5px;
    }
    
    .thread-entry time {
        color: #666;
        font-size: 0.9em;
    }
    
    .thread-entry .avatar {
        width: 40px;
        height: 40px;
        margin: 0 10px 10px 0;
    }
    
    .thread-entry.message .avatar {
        float: left;
    }
    
    .thread-entry.response .avatar {
        float: right;
    }
    
    .thread-body {
        clear: both;
        padding-top: 10px;
    }
    
    .thread-body div {
        font-size: 0.95em;
        line-height: 1.5;
    }
    
    .thread-body blockquote {
        background: #f8f9fa;
        border-left: 3px solid #ddd;
        padding: 8px 12px;
        margin: 8px 0;
    }
    
    .thread-event {
        display: flex;
        align-items: center;
        padding: 10px;
        margin: 15px 0;
        background: #f8fafc;
        border-radius: 6px;
        font-size: 0.9em;
    }
    
    .thread-event .type-icon {
        margin-right: 10px;
        font-size: 1.2em;
    }
    
    .thread-event .description {
        flex: 1;
    }
    
    .thread-event .description b {
        font-weight: 600;
    }
    
    .thread-event .description img.avatar {
        width: 20px;
        height: 20px;
        vertical-align: middle;
        margin-right: 5px;
    }
    
    .clear {
        clear: both;
    }
    
    /* Ajustes específicos para elementos flotantes */
    .pull-left {
        float: left !important;
    }
    
    .pull-right {
        float: right !important;
    }
    
    /* Asegurar que el texto no se salga */
    .truncate, .title {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}

/* Estilos para el FAQ - Categorías colapsables */

#kb {
    list-style: none;
    padding: 0;
    margin: 0;
}

#kb .category {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
}

#kb .category h4 {
    margin: 0;
}

#kb .category-toggle {
    display: block;
    padding: 10px;
    background: var(--color-bg);
    border-radius: var(--border-radius);
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

#kb .category-toggle:hover {
    background: var(--color-primary-light);
    color: white;
}

#kb .category-content {
    padding: 10px;
    margin-top: 10px;
    background: var(--color-card);
    border-radius: var(--border-radius);
}

#kb .subcategories {
    margin: 10px 0;
    padding-left: 20px;
}

#kb .popular-faq {
    padding: 8px 0;
    border-bottom: 1px dashed var(--color-border);
}

#kb .popular-faq:last-child {
    border-bottom: none;
}

#kb .popular-faq a {
    color: var(--color-text);
    transition: color 0.2s;
}

#kb .popular-faq a:hover {
    color: var(--color-primary);
}