/* style.css
 * Diseños y estilos modernos para la aplicación CMS.
 */

/* Variables de color para personalización fácil */
/* style.css */

/* style.css */

/* style.css (Versión Completa y Corregida) */

:root {
    --sidebar-bg: #1a202c; /* Gris oscuro/azulado para la barra lateral */
    --main-bg: #f7fafc;      /* Un gris muy claro para el fondo principal */
    --card-bg: #ffffff;      /* Blanco puro para las tarjetas */
    --primary-color: #4a55e1; /* Azul índigo como color de acento */
    --primary-hover: #434cd9; /* Un poco más oscuro para el hover */
    --secondary-color: #4a5568; /* Gris medio para botones secundarios */
    --secondary-hover: #2d3748; /* Gris más oscuro para el hover */
    --text-dark: #2d3748;    /* Color de texto principal */
    --text-light: #a0aec0;   /* Color de texto para elementos de la barra lateral */
    --border-color: #e2e8f0; /* Color de borde sutil */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-family: 'Inter', sans-serif; /* Fuente moderna y legible */
}

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

body {
    font-family: var(--font-family);
    background-color: var(--main-bg);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- ESTRUCTURA PRINCIPAL (LA PARTE QUE FALTABA) --- */
.dashboard-layout {
    display: flex; /* ¡Esta es la regla clave! Hace que los hijos (sidebar y main) se pongan uno al lado del otro */
    min-height: 100vh;
}

.main-content {
    flex-grow: 1; /* Permite que esta sección ocupe todo el espacio restante */
    padding: 2rem;
    overflow-y: auto; /* Añade scroll si el contenido es muy largo */
}
/* ---------------------------------------------------- */


/* --- Barra Lateral (Sidebar) --- */
.sidebar {
    width: 260px; /* Ancho fijo */
    background-color: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column; /* Organiza los elementos internos en vertical */
    flex-shrink: 0; /* Evita que la barra se encoja */
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #2d3748; /* Línea separadora sutil */
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
}

.sidebar-nav {
    flex-grow: 1; /* Empuja el footer hacia abajo */
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background-color: #2d3748;
    color: #fff;
}

.sidebar-nav a.active {
    background-color: rgba(74, 85, 225, 0.1); /* Fondo sutil para el enlace activo */
    color: #fff;
    border-left-color: var(--primary-color);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #2d3748;
}

.user-profile .user-email { 
    font-weight: 600; 
    color: #fff; 
    display: block; 
    margin-bottom: 0.8rem; 
    word-break: break-all;
}
.user-profile a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    text-decoration: none;
    margin-top: 0.75rem;
    transition: color 0.2s;
    font-size: 0.9rem;
}
.user-profile a:hover { color: #fff; }

/* --- Contenido Principal --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.main-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.content-grid {
    display: grid;
    gap: 1.5rem;
}

.card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* --- Formularios --- */
.add-site-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.form-group { flex: 1 1 250px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.9rem;}
input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 85, 225, 0.2);
}

/* --- Botones --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
.btn-secondary { background-color: var(--secondary-color); color: #fff; }
.btn-secondary:hover { background-color: var(--secondary-hover); transform: translateY(-2px); }

/* --- Tabla --- */
.table-responsive { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem 1.5rem; text-align: left; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
thead th { color: var(--text-light); font-weight: 600; text-transform: uppercase; font-size: 0.8rem; }
.site-info { display: flex; flex-direction: column; }
.site-name { font-weight: 600; }
.site-domain { color: var(--secondary-color); font-size: 0.9rem; }

/* --- Snippet --- */
.snippet-container { display: flex; align-items: center; background-color: #f7fafc; border-radius: 0.5rem; border: 1px solid var(--border-color); overflow: hidden; }
.snippet-container pre { margin: 0; padding: 0.75rem; flex-grow: 1; overflow-x: auto; }
.snippet-container code { font-family: 'SF Mono', 'Courier New', monospace; font-size: 0.9rem; }
.btn-copy {
    flex-shrink: 0;
    background: #e2e8f0;
    color: var(--secondary-color);
    padding: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.btn-copy:hover { background-color: #cbd5e0; }
.btn-copy.copied { background-color: #2ecc71; color: #fff; }

/* --- Alertas --- */
.alert { padding: 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }
.alert.success { background-color: #e6fffa; color: #237a6a; border: 1px solid #a8e5d9; }
.alert.error { background-color: #fff5f5; color: #c53030; border: 1px solid #fcb1b1; }
.alert-warning { padding: 2rem; text-align: center; background-color: #fffaf0; border: 1px solid #fbd38d; color: #975a16; border-radius: 0.75rem; }
.alert-warning i { font-size: 1.5rem; margin-bottom: 1rem; display: block; }

/* --- Estado Vacío (Empty State) --- */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; color: var(--primary-color); opacity: 0.6; margin-bottom: 1.5rem; }
.empty-state h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--secondary-color); margin-bottom: 2rem; max-width: 400px; margin-left: auto; margin-right: auto; }

/* --- Responsividad --- */
@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .dashboard-layout {
        flex-direction: column;
    }
    /* Ocultamos la navegación y el pie de la barra lateral para simplificar en móvil */
    .sidebar-nav, .sidebar-footer {
        display: none;
    }
    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    td, th {
        padding: 1rem 0.75rem;
    }
}








/* --- ESTILOS PARA LA PÁGINA DE LOGIN Y REGISTRO --- */

.login-page {
    background: linear-gradient(45deg, #4a55e1, #575fcf);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-out;
}

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

.login-logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem; /* Espacio para el icono */
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 85, 225, 0.2);
}

.input-wrapper > .fas {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
}

.input-wrapper .fa-envelope,
.input-wrapper .fa-lock,
.input-wrapper .fa-user {
    left: 1rem;
}

.toggle-password {
    right: 1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-dark);
}

.btn-block {
    width: 100%;
    padding: 0.85rem;
    margin-top: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Ajustes para el mensaje de error en la página de login */
.login-card .alert.error {
    margin-bottom: 1.5rem;
}











/* --- ESTILOS ADICIONALES PARA EL MENSAJE DE ÉXITO EN REGISTRO --- */

.success-message {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.success-icon {
    font-size: 3.5rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.success-message h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.success-message p {
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.success-message .btn {
    margin-top: 0;
}













header {
    background-color: #2c3e50;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

header nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav a:hover {
    background-color: #34495e;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

h2 {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

thead th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
}

.badge.yes {
    background-color: #28a745;
}

.badge.no {
    background-color: #dc3545;
}

/* Estilos para filtros (copiados de la etiqueta <style> por si se usan globalmente) */
.filters {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.filters form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filters label {
    font-weight: bold;
}

.filters select, .filters button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.filters button {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

.filters button:hover {
    background-color: #2980b9;
}

.filters .checkbox-filter {
    display: flex;
    align-items: center;
    gap: 5px;
}