/* --- ESTILOS GENERALES --- */
:root {
    --primary-color: #612b7d;
    /* Nuevo color Púrpura */
    --primary-light: #f3e5f5;
    /* Púrpura muy claro para fondos */
    --admin-bg: #f4f6f8;
    --sidebar-bg: #ffffff;
}

body {
    background-color: #f5f5f5;
    color: #424242;
    font-family: 'Roboto', sans-serif;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* --- NAVBAR --- */
nav {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

nav .brand-logo {
    font-weight: 300;
    color: #424242;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
    cursor: pointer;
}

nav .brand-logo span {
    color: var(--primary-color);
    font-weight: 700;
}

nav ul a {
    color: #616161;
    font-weight: 500;
}

nav ul a:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* --- VISTAS (SPA Logic) --- */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.view-section.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HOME: TARJETAS --- */
/* Utilizamos clases nativas para background y bordes si es necesario,
   pero mantenemos .card base limpio para que Materialize actúe. */
.card {
    /* Solo ajustes cosméticos menores si es estrictamente necesario */
    transition: box-shadow 0.3s ease;
}

/* Materialize ya maneja .hoverable, eliminamos overrides custom */

.card-content {
    padding: 24px !important;
}

.card-title {
    font-weight: 400 !important;
    color: #212121;
}

.card-action {
    background-color: #fff !important;
    border-top: 1px solid #eee !important;
}

.card-action a {
    color: var(--primary-color) !important;
    font-weight: 600;
    text-transform: uppercase;
}

.chip {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* --- DETALLES (BLOG VIEW MEJORADA) --- */
#view-details {
    padding-bottom: 50px;
}

.document-card {
    background: #fff;
    padding: 60px;
    margin-top: 20px;
    border-radius: 2px;
    /* Look más "papel" */
    min-height: 500px;
    position: relative;
}

.detail-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.detail-title {
    font-weight: 300;
    font-size: 2.5rem;
    color: #263238;
    margin: 0 0 10px 0;
}

.detail-meta {
    color: #78909c;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
}

.detail-meta i {
    margin-right: 5px;
    font-size: 16px;
}

.detail-content {
    font-size: 1.2rem;
    /* Texto más grande para lectura */
    line-height: 1.8;
    color: #37474f;
    font-family: 'Georgia', serif;
    /* Serif para cuerpo de texto mejora lectura larga */
}

.detail-content p {
    margin-bottom: 25px;
}

/* Imágenes Responsivas Globales */
.detail-content img,
.card-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- ADMIN PANEL PROFESIONAL --- */
#view-admin {
    background-color: var(--admin-bg);
    min-height: calc(100vh - 64px);
    /* Altura completa menos navbar */
}

.admin-layout {
    display: flex;
    min-height: 100%;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid #e0e0e0;
    padding-top: 20px;
    flex-shrink: 0;
    min-height: calc(100vh - 64px);
}

.admin-sidebar .collection {
    border: none;
}

.admin-sidebar .collection-item {
    border: none;
    color: #546e7a;
    font-weight: 500;
    padding: 15px 20px;
    transition: all 0.2s;
    cursor: pointer;
}

.admin-sidebar .collection-item i {
    margin-right: 15px;
    color: #90a4ae;
}

.admin-sidebar .collection-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.admin-sidebar .collection-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.admin-sidebar .collection-item.active i {
    color: var(--primary-color);
}

/* Main Content Admin */
.admin-main {
    flex-grow: 1;
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #cfd8dc;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Stats Cards */
.stat-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stat-info p {
    margin: 0;
    color: #90a4ae;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.stat-icon {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 15px;
    border-radius: 50%;
}

/* Tables */
.admin-table-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.admin-table-card table th {
    background: #fafafa;
    color: #546e7a;
    font-weight: 600;
}

/* --- LOGIN --- */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-width: 400px;
    margin: 80px auto;
}

/* --- UI COMPONENTS --- */
.btn-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: #4a148c !important;
}

/* Materialize overrides for specific focus colors */
.input-field input:focus+label,
.input-field textarea:focus+label {
    color: var(--primary-color) !important;
}

.input-field input:focus,
.input-field textarea:focus {
    border-bottom: 1px solid var(--primary-color) !important;
    box-shadow: 0 1px 0 0 var(--primary-color) !important;
}

.prefix.active {
    color: var(--primary-color) !important;
}

.search-compact {
    background-color: white;
    padding: 0px 15px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    height: 45px;
    display: flex;
    align-items: center;
}

.search-compact input {
    border-bottom: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

/* --- FOOTER --- */
.page-footer {
    background-color: #ffffff;
    color: #424242;
    border-top: 1px solid #eeeeee;
    padding-top: 40px;
    margin-top: 0;
    /* Reset margin top as admin view handles height */
}

.page-footer h5 {
    color: var(--primary-color);
    font-weight: 300;
}

.footer-links a {
    color: #616161;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    background-color: #fafafa !important;
    color: #757575 !important;
}

/* Media Queries */
@media only screen and (max-width: 992px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .document-card {
        padding: 30px;
    }
}