/* Estilos para el frontend de Redes */
.redes-frontend-table {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#frontend-redes-table {
    width: 100% !important;
    border-collapse: collapse;
}

#frontend-redes-table th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #e9ecef;
    color: #495057;
}

#frontend-redes-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    color: #6c757d;
    vertical-align: middle;
}

#frontend-redes-table tr:hover {
    background-color: #f8f9fa;
}

#frontend-redes-table a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.2s ease;
}

#frontend-redes-table a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Estilos para tooltips mejorados */
.image-link {
    display: inline-block;
    transition: transform 0.2s ease;
    position: relative;
}

.image-link:hover {
    transform: scale(1.1);
}

.image-link:hover::after {
    content: "Ir a Sitio";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.image-link:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
}

.image-link img {
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.image-link:hover img {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Responsive para frontend */
@media screen and (max-width: 768px) {
    .redes-frontend-table {
        padding: 10px;
        margin: 10px 0;
    }
    
    #frontend-redes-table {
        font-size: 14px;
    }
    
    #frontend-redes-table th,
    #frontend-redes-table td {
        padding: 8px 10px;
    }
}

/* Personalización de DataTables en frontend */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #007cba;
    border-radius: 4px;
    font-size: 14px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #005a87;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dataTables_wrapper .dataTables_info {
    color: #6c757d;
    font-size: 14px;
    padding-top: 10px;
}

/* Estilos para enlaces de URL */
.url-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: #e7f3ff;
    border-radius: 4px;
    color: #007cba;
    font-weight: 500;
}

.url-link:hover {
    background: #d1e9ff;
    text-decoration: none;
}

.url-link:before {
    content: "🔗";
    font-size: 12px;
}

/* Estados de carga */
.loading-table {
    opacity: 0.7;
    pointer-events: none;
}

/* Mensajes de estado */
.redes-frontend-message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.redes-frontend-info {
    background: #e7f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

.redes-frontend-error {
    background: #ffe6e6;
    color: #cc0000;
    border: 1px solid #ffb3b3;
}

/* Estilos para imágenes en frontend */
#frontend-redes-table img {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

#frontend-redes-table img:hover {
    border-color: #007cba;
}

/* Ajustes para tablas responsivas de DataTables */
@media screen and (max-width: 767px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: center;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
    }
    
    .dataTables_wrapper .dataTables_info {
        text-align: center;
    }
}

/* Scroll suave para tablas grandes */
.redes-frontend-table {
    overflow-x: auto;
}

/* Estilos para el contenedor principal */
.redes-container-frontend {
    max-width: 1200px;
    margin: 0 auto;
}

/* Encabezado de la tabla personalizado */
#frontend-redes-table thead th {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

/* Efectos hover mejorados */
#frontend-redes-table tbody tr {
    transition: all 0.3s ease;
}

#frontend-redes-table tbody tr:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#frontend-redes-table tbody tr:hover td {
    color: white;
}

#frontend-redes-table tbody tr:hover a {
    color: white;
    text-decoration: underline;
}


/* Estilos para imágenes en el frontend de Redes */
.redes-frontend-image {
    max-width: 80px;
    max-height: 60px;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    object-fit: cover;
    background: #f8f9fa;
    padding: 2px;
}

.redes-frontend-image:hover {
    border-color: #007cba;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Lightbox styles */
.redes-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.redes-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.redes-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.redes-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.redes-lightbox-close:hover {
    background: rgba(255, 0, 0, 0.7);
}

.redes-lightbox-caption {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
}

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

/* Estilos para enlaces de archivos no imagen */
.file-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.file-download-link:hover {
    background: #007cba;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.download-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.file-download-link:hover .download-icon {
    transform: scale(1.2);
    filter: brightness(0) invert(1);
}

/* Estados para cuando no hay archivo */
.no-file {
    color: #6c757d;
    font-style: italic;
    font-size: 13px;
}

/* Mejoras para la tabla */
#frontend-redes-table td {
    vertical-align: middle;
    text-align: center;
}

#frontend-redes-table .image-lightbox {
    display: inline-block;
    border-radius: 6px;
    overflow: hidden;
}

/* Efectos hover para las filas */
.redes-frontend-row:hover .redes-frontend-image {
    border-color: #007cba;
}

.redes-frontend-row:hover .file-download-link {
    border-color: #007cba;
}

/* Responsive para imágenes */
@media screen and (max-width: 768px) {
    .redes-frontend-image {
        max-width: 60px;
        max-height: 45px;
    }
    
    .file-download-link {
        width: 50px;
        height: 50px;
    }
    
    .redes-lightbox-content {
        max-width: 95%;
    }
    
    .redes-lightbox-content img {
        max-height: 70vh;
    }
}

/* Estilos para el enlace de URL */
.url-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
}

.url-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.url-link:before {
    content: "🌐";
    font-size: 12px;
}

/* Asegurar que las imágenes mantengan su proporción */
.redes-frontend-image {
    width: auto;
    height: auto;
}

/* Loading state para imágenes */
.redes-frontend-image[src=""] {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.redes-frontend-image:not([src]) {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    position: relative;
}

.redes-frontend-image:not([src]):before {
    content: "🖼️";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #6c757d;
}

/* Estilos mejorados para imágenes en frontend */
.image-container {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.image-container:hover {
    transform: translateY(-2px);
    border-color: #007cba;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.15);
}

.redes-frontend-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.zoom-icon {
    color: white;
    font-size: 18px;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-container:hover .zoom-icon {
    transform: scale(1);
}

/* Placeholder para cuando no hay imagen */
.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 60px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.no-image-placeholder:hover {
    border-color: #6c757d;
    background: #e9ecef;
}

.placeholder-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.placeholder-text {
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
}

/* Badges para los tipos */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-tipo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-caracter {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.badge-pais {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

/* Lightbox mejorado */
.redes-lightbox-open {
    overflow: hidden;
}

.redes-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.redes-lightbox-container {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.redes-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.redes-lightbox-title {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.redes-lightbox-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.redes-lightbox-close:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.redes-lightbox-body {
    padding: 20px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
}

.redes-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.redes-lightbox-error {
    text-align: center;
    color: #6c757d;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.redes-lightbox-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.redes-lightbox-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.redes-lightbox-download:hover {
    background: #005a87;
    color: white;
    transform: translateY(-2px);
}

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

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

/* Responsive */
@media screen and (max-width: 768px) {
    .redes-lightbox-container {
        max-width: 95%;
        max-height: 95%;
    }
    
    .redes-lightbox-header {
        padding: 15px;
    }
    
    .redes-lightbox-body {
        padding: 15px;
        max-height: 60vh;
    }
    
    .redes-lightbox-footer {
        padding: 15px;
    }
    
    .redes-frontend-image {
        width: 60px;
        height: 45px;
    }
    
    .no-image-placeholder {
        width: 60px;
        height: 45px;
    }
}

/* Enlace de URL mejorado */
.url-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 20px;
    color: white;
    font-weight: 500;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
}

.url-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    color: white;
}

.no-url {
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}