/* ===========================
   ESTILOS UNIFICADOS DE ADMINISTRACIÓN
   Para: panel-admin.htm, admin-noticias.php, reservas_admin.php, admin_autorizaciones_caminos.php
   =========================== */

/* Variables específicas para administración */
:root {
    /* Colores principales admin */
    --admin-bg: #f8fafc;
    --admin-principal: #2563eb;
    --admin-secundario: #1e40af;
    --admin-dark: #1d4ed8;
    --admin-white: #ffffff;
    --admin-acento: #3b82f6;
    --admin-shadow: rgba(0, 0, 0, 0.1);
    
    /* Colores de estado */
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-error: #ef4444;
    --admin-info: #06b6d4;
    
    /* Colores adicionales */
    --gris-oscuro: #374151;
    --gris-claro: #f3f4f6;
    --blanco: #ffffff;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   BODY STYLES POR TIPO DE ADMIN
   =========================== */

/* Body para panel general de admin */
body.admin-body {
    font-family: 'Segoe UI', 'Tahoma', sans-serif;
    background: linear-gradient(135deg, var(--admin-bg) 0%, #bdc3c7 100%);
    color: var(--admin-principal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Body para admin de noticias */
body.admin-noticias-body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--gris-oscuro) 0%, var(--admin-principal) 100%);
    color: var(--blanco);
    min-height: 100vh;
    padding: 20px;
}

/* Body para admin de reservas */
body.reservas-admin-body {
    font-family: 'trebuchet MS', 'Lucida sans', Arial;
    background: linear-gradient(135deg, var(--crema-montaña) 0%, var(--beige-piedra) 100%);
    color: var(--verde-pirineo-oscuro);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

/* ===========================
   HEADERS ADMINISTRATIVOS
   =========================== */

/* Header general admin */
.admin-header {
    background: linear-gradient(135deg, var(--admin-principal) 0%, var(--admin-secundario) 100%);
    color: var(--admin-white);
    padding: 20px 0;
    box-shadow: 0 4px 20px var(--admin-shadow);
    position: relative;
}

.admin-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--admin-acento), var(--admin-warning), var(--admin-success), var(--admin-info));
}

/* Header para noticias */
.header {
    background: var(--blanco);
    color: var(--admin-principal);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Header para reservas */
#header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--verde-pirineo-oscuro) 0%, var(--verde-pirineo) 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--sombra-suave);
}

#header h1 {
    font-weight: bold;
    font-size: 48px;
    font-family: "Arial";
    text-shadow: 0 1px 0 #ccc, 
                 0 2px 0 #c9c9c9,
                 0 3px 0 #bbb,
                 0 4px 0 #b9b9b9,
                 0 5px 0 #aaa,
                 0 6px 1px rgba(0,0,0,.1),
                 0 0 5px rgba(0,0,0,.1),
                 0 1px 3px rgba(0,0,0,.3),
                 0 3px 5px rgba(0,0,0,.2),
                 0 5px 10px rgba(0,0,0,.25),
                 0 10px 10px rgba(0,0,0,.2),
                 0 20px 20px rgba(0,0,0,.15);
    color: var(--blanco-nieve);
    text-align: center;
    margin: 0;
}

/* ===========================
   CONTENEDORES Y LAYOUT
   =========================== */

.container, .admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.admin-main {
    flex: 1;
    padding: 40px 0;
}

/* Grids principales */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* ===========================
   TARJETAS ADMINISTRATIVAS
   =========================== */

.admin-card, .content-card {
    background: var(--admin-white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px var(--admin-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

.admin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: 15px 15px 0 0;
}

.admin-card.noticias::before {
    background: linear-gradient(90deg, var(--admin-info), var(--admin-success));
}

.admin-card.reservas::before {
    background: linear-gradient(90deg, var(--admin-warning), var(--admin-acento));
}

.admin-card.autorizaciones::before {
    background: linear-gradient(90deg, #8e44ad, #9b59b6);
}

.admin-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px var(--admin-shadow);
}

.admin-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--admin-principal);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card p {
    color: var(--admin-secundario);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Secciones específicas */
.form-section, .news-section {
    background: var(--blanco);
    color: var(--gris-oscuro);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.form-section h2, .news-section h2 {
    color: var(--admin-principal);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* ===========================
   FORMULARIOS ADMINISTRATIVOS
   =========================== */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--gris-oscuro);
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gris-claro);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--admin-acento);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* File input personalizado */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: block;
    padding: 12px;
    border: 2px dashed var(--admin-principal);
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--admin-principal);
    font-weight: 600;
}

.file-input-label:hover {
    background: #f1f5f9;
    border-color: var(--admin-acento);
}

/* Preview de archivos */
.file-preview {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--admin-error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-image:hover {
    background: #dc2626;
}

/* ===========================
   BOTONES ADMINISTRATIVOS
   =========================== */

.btn, .admin-btn, .button {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px var(--admin-shadow);
}

.btn-primary, .admin-btn {
    background: linear-gradient(135deg, var(--admin-principal) 0%, var(--admin-secundario) 100%);
    color: var(--admin-white);
}

.btn-primary:hover, .admin-btn:hover {
    background: linear-gradient(135deg, var(--admin-dark) 0%, var(--admin-principal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--admin-shadow);
}

.btn-success {
    background: var(--admin-success);
    color: var(--admin-white);
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--admin-warning);
    color: var(--admin-white);
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--admin-error);
    color: var(--admin-white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
    margin: 0 5px;
}

/* Botones específicos para footable */
.button.blue {
    background: linear-gradient(135deg, var(--admin-principal) 0%, var(--admin-acento) 100%);
    color: var(--blanco-nieve);
}

.button.blue:hover {
    background: linear-gradient(135deg, var(--admin-dark) 0%, var(--admin-principal) 100%);
}

/* ===========================
   TABLAS ADMINISTRATIVAS
   =========================== */

.footable, .solicitudes-table {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    font-family: 'trebuchet MS', 'Lucida sans', Arial;
    font-size: 14px;
    color: var(--verde-pirineo-oscuro);
    border: solid var(--verde-sage) 2px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 15px;
    background: var(--blanco-nieve);
    box-shadow: 0 8px 25px var(--sombra-suave);
    overflow: hidden;
}

.footable > tbody > tr > td, 
.footable > thead > tr > th,
.solicitudes-table th,
.solicitudes-table td {
    border-left: 1px solid var(--verde-sage);
    border-top: 1px solid var(--verde-sage);
    padding: 15px 12px;
    text-align: left;
    vertical-align: middle;
}

.footable > thead > tr > th, 
.footable > thead > tr > td,
.solicitudes-table th {
    background: linear-gradient(135deg, var(--admin-principal) 0%, var(--admin-acento) 100%);
    color: var(--blanco-nieve);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.footable tbody tr,
.solicitudes-table tr {
    transition: all 0.3s ease;
}

.footable tbody tr:nth-child(even),
.solicitudes-table tr:nth-child(even) {
    background: linear-gradient(135deg, var(--crema-montaña) 0%, var(--blanco-nieve) 100%);
}

.footable tbody tr:nth-child(odd) {
    background: var(--blanco-nieve);
}

.footable tbody tr:hover,
.solicitudes-table tr:hover {
    background: linear-gradient(135deg, var(--admin-acento) 0%, var(--admin-info) 100%);
    color: var(--blanco-nieve);
    transform: scale(1.02);
    box-shadow: 0 4px 15px var(--admin-shadow);
}

/* ===========================
   MENSAJES Y ALERTAS
   =========================== */

.mensaje {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.5;
}

.mensaje.exito {
    background: #d1fae5;
    color: var(--admin-success);
    border: 2px solid var(--admin-success);
}

.mensaje.error {
    background: #fee2e2;
    color: var(--admin-error);
    border: 2px solid var(--admin-error);
}

.warning-text {
    background: #fef3c7;
    color: #92400e;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--admin-warning);
}

/* ===========================
   NOTICIAS ADMINISTRATIVAS
   =========================== */

.news-item {
    background: var(--gris-claro);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid var(--admin-principal);
}

.news-item h3 {
    color: var(--admin-principal);
    margin-bottom: 10px;
}

.news-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.news-body {
    line-height: 1.6;
    margin-bottom: 15px;
}

.news-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.news-thumbnails {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    flex-wrap: wrap;
}

.news-thumbnail {
    width: 40px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--admin-principal);
}

/* ===========================
   ESTADÍSTICAS
   =========================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--admin-white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--admin-shadow);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-acento);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--admin-secundario);
    font-weight: 600;
}

/* ===========================
   UTILIDADES ADMINISTRATIVAS
   =========================== */

.admin-title {
    text-align: center;
    margin-bottom: 10px;
}

.admin-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.admin-title p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.cancel-edit {
    background: var(--gris-oscuro);
    color: var(--blanco);
}

.cancel-edit:hover {
    background: #4b5563;
}

.back-link {
    display: inline-block;
    color: var(--admin-principal);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: var(--admin-acento);
    color: var(--admin-white);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--admin-secundario);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* ===========================
   ANIMACIONES
   =========================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-card:nth-child(1) { animation-delay: 0.1s; }
.admin-card:nth-child(2) { animation-delay: 0.2s; }
.admin-card:nth-child(3) { animation-delay: 0.3s; }

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
    .admin-container {
        padding: 0 15px;
    }

    .admin-title h1 {
        font-size: 2rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .admin-card {
        padding: 20px;
    }

    .main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }

    .form-buttons {
        flex-direction: column;
    }

    .news-actions {
        flex-direction: column;
    }

    .footable {
        width: 100%;
        font-size: 12px;
    }
    
    .footable > tbody > tr > td, 
    .footable > thead > tr > th {
        padding: 10px 8px;
    }

    #header h1 {
        font-size: 32px;
    }

    .solicitudes-table {
        font-size: 0.8rem;
    }

    .solicitudes-table th,
    .solicitudes-table td {
        padding: 8px 6px;
    }
}

/* ===========================
   MODAL DE DETALLE DE SOLICITUDES
   =========================== */

/* Overlay del modal */
.detail-view {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 41, 55, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

/* Contenedor del modal */
.detail-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: slideInUp 0.4s ease-out;
    border: 2px solid rgba(37, 99, 235, 0.1);
}

/* Cabecera del modal */
.detail-content h3 {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    margin: 0;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.detail-content h3::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981, #f59e0b);
}

/* Botón de cerrar */
.detail-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.detail-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* Contenido del modal */
#detailContent {
    padding: 30px;
}

/* Campos del detalle */
.detail-field {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(203, 213, 225, 0.5);
    transition: all 0.2s ease;
}

.detail-field:hover {
    background: rgba(59, 130, 246, 0.02);
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

.detail-field:last-child {
    border-bottom: none;
}

/* Etiquetas de campo */
.detail-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-label::before {
    content: '📋';
    font-size: 1rem;
    opacity: 0.7;
}

/* Valores de campo */
.detail-value {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.5;
    padding: 8px 12px;
    background: rgba(243, 244, 246, 0.6);
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
    word-break: break-word;
}

/* Estilos específicos para ciertos campos */
.detail-field:nth-child(1) .detail-label::before { content: '📅'; }
.detail-field:nth-child(2) .detail-label::before { content: '👤'; }
.detail-field:nth-child(3) .detail-label::before { content: '📍'; }
.detail-field:nth-child(4) .detail-label::before { content: '🏘️'; }
.detail-field:nth-child(5) .detail-label::before { content: '🏛️'; }
.detail-field:nth-child(6) .detail-label::before { content: '📮'; }
.detail-field:nth-child(7) .detail-label::before { content: '📞'; }
.detail-field:nth-child(8) .detail-label::before { content: '🆔'; }
.detail-field:nth-child(9) .detail-label::before { content: '🚗'; }
.detail-field:nth-child(10) .detail-label::before { content: '📧'; }
.detail-field:nth-child(11) .detail-label::before { content: '🏠'; }

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Scrollbar personalizada para el modal */
.detail-content::-webkit-scrollbar {
    width: 6px;
}

.detail-content::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 3px;
}

.detail-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 3px;
}

.detail-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .detail-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }
    
    .detail-content h3 {
        padding: 20px 25px;
        font-size: 1.2rem;
    }
    
    .detail-close {
        top: 12px;
        right: 15px;
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    #detailContent {
        padding: 20px;
    }
    
    .detail-field {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 0;
    }
    
    .detail-label {
        font-size: 0.9rem;
        font-weight: 700;
        color: #2563eb;
    }
    
    .detail-value {
        margin-left: 0;
        font-size: 0.95rem;
    }
} 