/* 🎨 ESTILOS DEL PANEL DE ADMINISTRACIÓN */

:root {
    /* Colores principales */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    
    /* Colores de estado */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Colores de fondo */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    
    /* Colores de texto */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    /* Colores de borde */
    --border-color: #dee2e6;
    --border-color-light: #e9ecef;
    
    /* Sombras */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Bordes redondeados */
    --radius: 0.5rem;
    --radius-sm: 0.25rem;
    --radius-lg: 1rem;
    
    /* Transiciones */
    --transition: all 0.3s ease;
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 🎯 HEADER DEL ADMIN */
.admin-header {
    background: linear-gradient(135deg, var(--secondary-color), #764ba2);
    color: white;
    padding: 2rem 0;
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.admin-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.admin-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 📝 FORMULARIO DE NOTICIAS */
.add-news-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.add-news-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 0.25rem;
}

.checkbox-label {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* 🔘 BOTONES */
.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

/* 📰 LISTA DE NOTICIAS */
.news-list-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.news-list-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    min-width: 200px;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 📋 LISTA DE NOTICIAS */
.news-list {
    display: grid;
    gap: 1rem;
}

.news-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--secondary-color);
    transition: var(--transition);
}

.news-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.news-item.featured {
    border-left-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05), rgba(255, 107, 53, 0.02));
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.news-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.news-category {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.news-summary {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.news-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-edit {
    background: var(--warning-color);
    color: var(--text-primary);
}

.btn-edit:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* 🔚 FOOTER */
.admin-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    margin-top: 3rem;
}

/* 📱 RESPONSIVE */
@media (max-width: 768px) {
    .admin-container {
        padding: 0 15px;
    }
    
    .admin-header h1 {
        font-size: 2rem;
    }
    
    .add-news-section,
    .news-list-section {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .news-filters {
        flex-direction: column;
    }
    
    .search-input,
    .filter-select {
        min-width: 100%;
    }
    
    .news-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ✨ ANIMACIONES */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-item {
    animation: fadeIn 0.5s ease;
}

/* 🎨 ESTADOS */
.success-message {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.error-message {
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
} 

/* 🌐 SECCIÓN DE ESTADO DE API */
.api-status-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary-color);
}

.api-status-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-status-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.api-info {
    flex: 1;
    min-width: 300px;
}

.api-info p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.api-info strong {
    color: var(--secondary-color);
}

/* Estados de la API */
.status-active {
    color: var(--success-color);
    font-weight: 600;
}

.status-inactive {
    color: var(--danger-color);
    font-weight: 600;
}

.api-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 📊 ESTADOS DEL SERVICIO */
.service-status {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 2rem;
}

.service-status h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-status p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.service-status strong {
    color: var(--secondary-color);
}

/* 🔄 NOTIFICACIONES DE ACTUALIZACIÓN */
.update-notification {
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: slideInDown 0.5s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 📱 RESPONSIVE PARA API */
@media (max-width: 768px) {
    .api-status-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .api-info {
        min-width: auto;
    }
    
    .api-actions {
        justify-content: center;
    }
    
    .api-actions .btn-primary,
    .api-actions .btn-secondary {
        flex: 1;
        min-width: 120px;
    }
} 

/* 📊 MODAL DE ESTADO DEL SERVICIO */
.status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.status-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-modal-header {
    background: linear-gradient(135deg, var(--secondary-color), #764ba2);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.status-modal-body {
    padding: 2rem;
}

.status-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.status-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.status-section h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-section p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.status-section strong {
    color: var(--secondary-color);
}

/* 🔄 ESTADOS DE ACTUALIZACIÓN */
.updating {
    color: var(--warning-color) !important;
    font-weight: 600;
}

.idle {
    color: var(--success-color) !important;
    font-weight: 600;
}

/* 📤 BOTONES DE EXPORTAR/IMPORTAR */
.news-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.news-filters .btn-secondary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* 📱 RESPONSIVE PARA MODAL */
@media (max-width: 768px) {
    .status-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .status-modal-header {
        padding: 1rem;
    }
    
    .status-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .status-modal-body {
        padding: 1.5rem;
    }
    
    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
} 

/* Modal de estado detallado */
.api-status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.api-status-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInUp 0.3s ease;
}

.api-status-modal-header {
    background: linear-gradient(135deg, var(--secondary-color), #764ba2);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-status-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.api-status-modal-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-status-modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.api-status-modal-body {
    padding: 2rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    border-bottom: none;
}

.status-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.apis-list {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.apis-list h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.api-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color-light);
}

.api-item:last-child {
    border-bottom: none;
}

.api-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 