/* news/core/admin-styles.css - Estilos del Panel de Administración */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #c1272d;
    --primary-dark: #8b1a1e;
    --primary-light: #ff4757;
    --secondary: #2c3e50;
    --accent: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --border: #e1e8ed;
    --text: #2c3e50;
    --text-muted: #6c757d;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: var(--gradient-primary);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.p-2 { padding: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 1rem; }

/* ===== LOGIN SCREEN ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: slideInUp 0.6s ease-out;
}

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

.login-logo {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.3rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.security-badge {
    background: var(--gradient-success);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* ===== FORMULARIOS ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Formularios horizontales para el panel admin */
.admin-card .form-group {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.admin-card .form-group label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 0.8rem;
}

.admin-card .form-group input,
.admin-card .form-group textarea,
.admin-card .form-group select {
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
    background: white;
    font-family: inherit;
    width: 100%;
}

/* Para el login mantenemos el diseño vertical */
.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form .form-group input,
.login-form .form-group textarea,
.login-form .form-group select {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.75rem;
    grid-column: 2;
    margin-top: 0.25rem;
}

/* ===== CAPTCHA ===== */
.captcha-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 0.8rem 0;
}

.captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.captcha-type {
    background: var(--gradient-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.captcha-timer {
    background: var(--success);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.captcha-timer.warning {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.captcha-timer.expired {
    background: var(--danger);
    animation: shake 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.captcha-content {
    margin-bottom: 0.8rem;
}

.captcha-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.captcha-visual {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.8rem;
    box-shadow: var(--shadow-sm);
    font-size: 1.8rem;
    letter-spacing: 3px;
}

.captcha-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.captcha-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
}

.captcha-refresh {
    padding: 0.8rem;
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    min-width: 45px;
}

.captcha-refresh:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.captcha-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.captcha-option {
    padding: 0.8rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: var(--transition);
}

.captcha-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.captcha-option.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

/* ===== BOTONES ===== */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-btn {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-lg);
    margin-top: 1rem;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--accent) 0%, #2980b9 100%);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #c0392b 100%);
    color: white;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

/* ===== MENSAJES ===== */
.error-message,
.success-message,
.attempts-warning {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
    display: none;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.error-message {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border-left: 4px solid #c0392b;
}

.success-message {
    background: var(--gradient-success);
    color: white;
    border-left: 4px solid #27ae60;
}

.attempts-warning {
    background: var(--gradient-warning);
    color: white;
    border-left: 4px solid #e67e22;
}

/* ===== ADMIN PANEL ===== */
.admin-panel {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #fde2e4 100%);
}

.admin-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.session-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.security-status {
    background: var(--gradient-success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.logout-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.admin-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    overflow-x: auto;
    min-height: 60px;
}

.tab {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-width: 180px;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
}

.tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* ===== TAB CONTENT ===== */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.admin-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== BANNER INFORMATIVO ===== */
.info-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

.info-banner h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.info-banner code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
}

/* ===== VISTA PREVIA ===== */
.preview {
    background: var(--light);
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.preview h3 {
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ===== LISTA DE NOTICIAS ===== */
.noticias-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.noticia-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.noticia-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.noticia-info {
    flex: 1;
}

.noticia-info h4 {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.noticia-info span {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.noticia-info p {
    margin-top: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.noticia-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== ESTADÍSTICAS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

/* ===== SISTEMA NEWS ===== */
.system-structure {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.system-structure h3 {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.system-structure pre {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    overflow-x: auto;
}

.system-status {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #2196f3;
}

.system-status h4 {
    color: #1565c0;
    margin-bottom: 1rem;
    font-weight: 600;
}

.instructions-box {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    color: #856404;
    border-left: 4px solid #f39c12;
}

.instructions-box ol {
    margin: 0.5rem 0 0 1.5rem;
}

.instructions-box code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-container {
        padding: 1rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        padding: 0.75rem 1rem;
        min-width: auto;
    }
    
    .noticia-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .noticia-actions {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .captcha-options {
        grid-template-columns: 1fr;
    }
    
    .session-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Formularios responsive - volver a vertical en móvil */
    .admin-card .form-group {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .admin-card .form-group label {
        padding-top: 0;
    }
    
    .form-group small {
        grid-column: 1;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.login-logo {
    animation: float 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(193, 39, 45, 0.5); }
    50% { box-shadow: 0 0 20px rgba(193, 39, 45, 0.8); }
}

.login-btn:hover {
    animation: glow 1s ease-in-out infinite;
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== ESTADOS DE CARGA ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}