/* --- Variables de Diseño --- */
:root {
    --color-bg: #1a1a1b;
    --color-surface: #272729;
    --color-primary: #00a8e8;
    --color-text: #e8e6e3;
    --color-text-muted: #a5a4a1;
    --color-border: #4a4a4c;
    --font-main: 'Ubuntu', sans-serif; /* Usamos la fuente que te gusta */
}

/* --- Estilos Globales y Reseteo --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* --- Cabecera --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    border-bottom: 1px solid var(--color-border);
}
.header-title h1 {
    font-size: 2.5rem;
    color: var(--color-primary);
}
.header-title p {
    color: var(--color-text-muted);
    margin-top: -5px;
}
.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}
.nav-link:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
}

/* --- Contenedor Principal y Columnas --- */
.container {
    display: flex;
    gap: 2rem;
    padding: 2rem 5%;
    align-items: flex-start;
}
.column {
    background-color: var(--color-surface);
    border-radius: 12px;
    padding: 1.5rem;
    flex: 1;
}
.column h2 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}
.column h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

/* --- Estilos Específicos de Widgets --- */
.stat-item { margin-bottom: 1.5rem; }
.stat-header { display: flex; align-items: center; gap: 0.7rem; color: var(--color-text-muted); margin-bottom: 0.3rem; }
.stat-item p { font-size: 1.2rem; font-weight: bold; }
.progress-bar-container { background-color: var(--color-bg); border-radius: 5px; height: 10px; overflow: hidden; margin-top: 0.5rem; }
.progress-bar { height: 100%; background-color: var(--color-primary); border-radius: 5px; width: 0%; transition: width 0.5s ease-out; }
.social-links { list-style: none; }
.social-links li { margin-bottom: 1rem; }
.social-links a { color: var(--color-text); text-decoration: none; font-size: 1.1rem; transition: color 0.2s; }
.social-links a:hover { color: var(--color-primary); }
.social-links i { margin-right: 1rem; width: 20px; color: var(--color-primary); }

/* --- Estilos para Control Page --- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat-item-grid { background-color: var(--color-bg); padding: 1rem; border-radius: 8px; }
.stat-item-grid.full-width { grid-column: 1 / -1; }
.stat-item-grid p { font-size: 1.5rem; font-weight: bold; text-align: right; }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--color-bg);
    padding: 1.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease-in-out;
}
.tool-card:hover {
    transform: translateY(-5px);
    background-color: var(--color-primary);
    color: var(--color-bg);
}
.tool-card i { font-size: 2rem; }

.form-intro {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}
#contact-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
#contact-form input,
#contact-form textarea {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.8rem;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 1rem;
}
#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}
#contact-form button {
    background-color: var(--color-primary);
    border: none;
    border-radius: 8px;
    padding: 0.8rem;
    color: var(--color-bg);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
#contact-form button:hover {
    background-color: #0077b6; /* Un tono de azul más oscuro */
}

/* --- Pie de Página y Diseño Responsivo --- */
footer { text-align: center; padding: 2rem; color: var(--color-text-muted); }
@media (max-width: 900px) {
    .container { flex-direction: column; }
    header { flex-direction: column; gap: 1rem; text-align: center; }
}
.top-processes-title {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text);
}
.process-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
.process-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-bg);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}
.process-list .proc-cpu {
    font-weight: bold;
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}
.process-list .proc-details {
    text-align: right;
}
.process-list .proc-cmd {
    font-family: monospace;
}
.process-list .proc-user {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.h2-link {
    text-decoration: none; /* Quita el subrayado del enlace */
    color: inherit; /* Hace que el enlace herede el color del texto normal del h2 */
}

.h2-link h2 {
    /* El h2 ya hereda los estilos de los otros títulos, pero añadimos una transición */
    transition: color 0.2s ease-in-out;
}

.h2-link:hover h2 {
    color: var(--color-primary); /* Al pasar el ratón, el título (y el icono) cambia de color */
}

.h2-link h2 i {
    margin-right: 0.7rem; /* Mantiene un espacio entre el icono y el texto */
}

/* --- ESTILOS PARA LA PÁGINA DE CÁMARAS --- */
#camera-list {
    list-style: none;
    max-height: 60vh;
    overflow-y: auto;
}
#camera-list li {
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--color-border);
}
#camera-list li:hover {
    background-color: var(--color-bg);
}
#camera-list li.active {
    background-color: var(--color-primary);
    color: var(--color-bg);
    font-weight: bold;
}

#viewer-placeholder { text-align: center; padding: 4rem 2rem; color: var(--color-text-muted); }
#viewer-placeholder i { font-size: 5rem; margin-bottom: 1rem; }

.photo-carousel {
    position: relative;
    margin-bottom: 1.5rem;
}
#camera-image {
    width: 100%;
    border-radius: 12px;
    display: block;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(26, 26, 27, 0.7);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.carousel-btn:hover { background-color: var(--color-primary); }
#prev-photo { left: 0; border-radius: 0 12px 12px 0; }
#next-photo { right: 0; border-radius: 12px 0 0 12px; }

.camera-date { color: var(--color-text-muted); font-style: italic; }


/* --- CÓDIGO AÑADIDO PARA EL FADE-IN --- */
#viewer-content {
    opacity: 0; /* Por defecto, el contenido está invisible */
    transition: opacity 0.4s ease-in-out; /* La animación de fade durará 0.4s */
}

#viewer-content.visible {
    opacity: 1; /* Cuando tenga esta clase, se hará visible */
}

.hidden { display: none !important; }
