/* ==========================================================================
   LETS MINGLE - ESTILOS GENERALES
   ========================================================================== */

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

/* ==========================================================================
   SECCIONES Y BLOQUES
   ========================================================================== */

.section {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    border-left: 4px solid #495057;
}

.section-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.block {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
}

.block-title {
    font-size: 1.3rem;
    color: #495057;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Sección de filtrado específica */
.filter-section {
    background: #e8f5e8;
    border-left-color: #28a745;
}

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.form-row > div {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #343a40;
    font-weight: 500;
}

/* Estilos unificados para inputs, textareas y selects */
input[type="text"], 
input[type="number"], 
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: all 0.3s ease;
    appearance: none; /* Elimina estilos por defecto del navegador */
}

/* Estilos específicos para select */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Estados de focus para todos los elementos de formulario */
input[type="text"]:focus, 
input[type="number"]:focus, 
textarea:focus,
select:focus {
    outline: none;
    border-color: #495057;
    box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.1);
}

/* Estados hover para select */
select:hover {
    border-color: #adb5bd;
}

/* Estados disabled para select */
select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Estilos para las opciones del select */
select option {
    padding: 8px 12px;
    background-color: white;
    color: #495057;
}

select option:hover {
    background-color: #f8f9fa;
}

select option:disabled {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* Placeholder para select (primera opción) */
select option[value=""] {
    color: #6c757d;
    font-style: italic;
}

textarea {
    height: 80px;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 4px;
    display: block;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */

.btn {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 58, 64, 0.3);
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

.btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ==========================================================================
   ALERTAS Y MENSAJES
   ========================================================================== */

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.note {
    background: #e9ecef;
    border: 1px solid #adb5bd;
    color: #495057;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* ==========================================================================
   TABLAS Y CONTENEDORES DE SCROLL
   ========================================================================== */

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
    padding: 12px;
    text-align: left;
}

.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    word-wrap: break-word;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Indicador de scroll */
.scroll-indicator {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
    padding: 4px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 4px;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ==========================================================================
   ELEMENTOS ESPECIALES
   ========================================================================== */

.text-truncate {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.client-id {
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, monospace;
    font-weight: bold;
    color: #1976d2;
    font-size: 0.9em;
}

.badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: bold;
    display: inline-block;
}

.badge-profile {
    background: #6f42c1;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: bold;
    display: inline-block;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        border-radius: 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-row > div {
        flex: none;
    }
    
    .table-container {
        max-height: 300px;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    .text-truncate {
        max-width: 120px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .form-row .btn {
        width: auto;
        margin-top: 10px;
    }
    
    /* Select responsive */
    select {
        background-size: 14px;
        background-position: right 10px center;
        padding-right: 35px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 15px;
    }
    
    .block {
        padding: 15px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
    
    .text-truncate {
        max-width: 100px;
    }
    
    /* Select más pequeño en móvil */
    select {
        padding: 10px;
        background-size: 12px;
        padding-right: 30px;
    }
}

/* ==========================================================================
   UTILIDADES Y HELPERS
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
.visible { display: block; }

/* Estados de carga */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .header {
        background: #2c3e50 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .btn, .form-group, .form-row {
        display: none;
    }
    
    .table-container {
        max-height: none;
        overflow: visible;
        border: 1px solid #000;
    }
    
    .data-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ==========================================================================
   ESTILOS PARA BANNERS DE BLOQUES - TAMAÑO GRANDE
   ========================================================================== */

/* Contenedor para título con imagen banner */
.block-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 1.3rem;
    color: #495057;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Imagen banner de gran tamaño */
.block-title img {
    width: 100%;
    height: 350px; /* Altura aumentada significativamente para efecto banner */
    margin-right: 0;
    margin-bottom: 20px;
    border-radius: 15px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transition: all 0.4s ease;
    cursor: pointer;
}

/* Efecto hover más dramático para banners grandes */
.block-title img:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
    border-radius: 12px;
}

/* Texto del título centrado y más prominente */
.block-title .title-text {
    width: 100%;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   RESPONSIVE PARA BANNERS GRANDES
   ========================================================================== */

@media (max-width: 1024px) {
    .block-title img {
        height: 300px;
        border-radius: 12px;
    }
    
    .block-title .title-text {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .block-title img {
        height: 250px;
        margin-bottom: 15px;
        border-radius: 10px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    }
    
    .block-title .title-text {
        font-size: 1.4rem;
    }
    
    .block-title img:hover {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    }
}

@media (max-width: 480px) {
    .block-title img {
        height: 200px;
        margin-bottom: 12px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }
    
    .block-title {
        font-size: 1.2rem;
    }
    
    .block-title .title-text {
        font-size: 1.3rem;
        font-weight: 600;
    }
    
    .block-title img:hover {
        transform: scale(1.01);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }
}

/* ==========================================================================
   ESTADOS DE CARGA PARA BANNERS
   ========================================================================== */

/* Placeholder animado mientras carga la imagen */
.block-title img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite;
}

/* Animación de carga shimmer */
@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Cuando la imagen está cargada, remover el efecto shimmer */
.block-title img.loaded {
    background: none;
    animation: none;
}

/* ==========================================================================
   MEJORAS DE ACCESIBILIDAD PARA BANNERS
   ========================================================================== */

/* Border sutil para mejor definición */
.block-title img {
    border: 2px solid rgba(0,0,0,0.03);
}

/* Focus mejorado para accesibilidad por teclado */
.block-title img:focus {
    outline: 3px solid #495057;
    outline-offset: 3px;
    border-radius: 12px;
}

/* Indicador de que la imagen es interactiva */
.block-title img:hover {
    cursor: pointer;
}

/* ==========================================================================
   ESTILOS ADICIONALES PARA MEJORAR LA EXPERIENCIA VISUAL
   ========================================================================== */

/* Gradiente sutil superpuesto para mejor contraste de texto si es necesario */
.block-title {
    position: relative;
}

/* Overlay opcional para texto sobre imagen (si se necesita en el futuro) */
.block-title .overlay-text {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.block-title:hover .overlay-text {
    opacity: 1;
}