/*
 * Estilos generales para Web GL CBC
 * Este archivo define una paleta de colores, tipografía y estilos reutilizables
 */

/* Variables de colores */
:root {
    /* Paleta renovada para aspecto profesional y moderno */
    --color-primary: #004080; /* azul corporativo más claro */
    --color-secondary: #f7f9fc; /* gris muy claro para fondos suaves */
    --color-accent: #d4af37; /* dorado elegante más luminoso */
    --color-dark: #05274a; /* azul oscuro atenuado para contrastar sin ser muy pesado */
    --color-light: #ffffff;
    --color-muted: #7a8fa1; /* tonos gris-azulados para textos secundarios */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", Arial, sans-serif;
}

body {
    background-color: var(--color-light);
    color: var(--color-dark);
    line-height: 1.6;
}

/* Contenedor global */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Encabezado */
.header {
    background: var(--color-dark);
    padding: 1rem 0;
    color: var(--color-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-block;
    margin-right: 1rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav a {
    color: var(--color-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav a:hover {
    color: var(--color-accent);
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.3rem;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

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

.btn-primary:hover {
    background: #1e39a0;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--color-light);
    color: var(--color-light);
}

.btn-secondary:hover {
    background: var(--color-light);
    color: var(--color-dark);
}

/* Hero */
.hero {
    background: url('../24f476a6-368b-43e2-aada-54566bc6e52c.png') center/cover no-repeat;
    color: var(--color-light);
    padding: 6rem 0;
    text-align: center;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero .actions a {
    margin: 0 0.5rem;
}

/* Features */
.features {
    background: var(--color-secondary);
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--color-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-card .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--color-muted);
}

/* Pricing */
.pricing {
    padding: 4rem 0;
}

.pricing h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.pricing-card {
    background: var(--color-light);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.pricing-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.pricing-card .price {
    font-size: 2rem;
    margin: 1rem 0;
    color: var(--color-primary);
}

.pricing-card ul {
    list-style: none;
    flex-grow: 1;
}

.pricing-card ul li {
    margin: 0.3rem 0;
}

.pricing-card .btn {
    margin-top: 1rem;
}

/* Contact */
.contact {
    background: var(--color-secondary);
    padding: 4rem 0;
}

.contact h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.contact p {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-muted);
}

/* === Secciones del sitio público === */
.about,
.services,
.contact {
    padding: 3rem 0;
}

.about h2,
.services h2,
.contact h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
    text-align: center;
}

.about p,
.contact p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.service-item {
    background: var(--color-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.service-item:hover {
    transform: translateY(-4px);
}

.service-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.service-item p {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.footer {
    background: var(--color-dark);
    color: var(--color-light);
    padding: 1rem 0;
    text-align: center;
}

/* === Estilos para el chat en la intranet === */
.chat-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.chat-users {
    width: 25%;
    border-right: 1px solid var(--color-secondary);
    padding: 0.5rem;
}
.chat-users ul {
    list-style: none;
    padding: 0;
}
.chat-users li {
    margin-bottom: 0.5rem;
}
.chat-users a {
    color: var(--color-primary);
    text-decoration: none;
}
.chat-users a:hover {
    text-decoration: underline;
}
.chat-conversation {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    background: var(--color-light);
}
.chat-conversation #chatMessages {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    max-height: 300px;
}
.chat-message {
    margin-bottom: 0.5rem;
}
.chat-message small {
    color: var(--color-muted);
    font-size: 0.7rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 0.75rem;
    border-radius: 0.3rem;
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

.contact-form button {
    align-self: flex-start;
}

/* Footer */
.footer {
    background: var(--color-dark);
    color: var(--color-light);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.8rem;
}

/* Formularios de autenticación */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-secondary);
    padding: 2rem;
}

.auth-card {
    background: var(--color-light);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.auth-card label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.auth-card input,
.auth-card select {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.3rem;
    font-size: 0.9rem;
}

.auth-card button {
    width: 100%;
}

/* Dashboard */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--color-dark);
    color: var(--color-light);
    border-right: 1px solid var(--color-primary);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.sidebar button {
    background: transparent;
    border: none;
    color: var(--color-light);
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar button:hover,
    .sidebar button.active {
    background: var(--color-primary);
    color: var(--color-light);
}

/* Ajuste de hover para diferenciar botones */
.sidebar button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-light);
}

/* Estilo especial para botón de cierre de sesión */
#nav-logout {
    margin-top: auto;
    background: var(--color-accent);
    color: var(--color-dark);
}
#nav-logout:hover {
    background: #bfa227;
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--color-secondary);
}

.module {
    display: none;
}

.module.active {
    display: block;
}

.module h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th,
td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
    font-size: 0.9rem;
}

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

tr:nth-child(even) {
    background: var(--color-light);
}

tr:nth-child(odd) {
    background: #f8f8f8;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 0.3rem;
    font-size: 0.9rem;
}

.form-group button {
    margin-top: 0.5rem;
}

/* Badges for status */
.badge {
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    color: var(--color-light);
    display: inline-block;
}

.badge.open {
    background: var(--color-primary);
}

.badge.closed {
    background: #28a745;
}

.badge.pending {
    background: #ffc107;
    color: #333;
}

/* Tarjetas y listas para el módulo de inicio */
.cards-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.card {
    background: var(--color-light);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1 1 200px;
}

.card h3 {
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.card p {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Tarjetas específicas para mostrar cada causa en formato más amigable */
.case-card {
    background: var(--color-light);
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.case-card h4 {
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.case-card p {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 0.3rem;
}

.case-card .actions {
    margin-top: 0.5rem;
}

.case-card .actions button {
    margin-right: 0.3rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.list {
    list-style: none;
    padding-left: 0;
}

.list li {
    margin-bottom: 0.3rem;
}

.muted {
    color: var(--color-muted);
}

.btn-xs {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.3rem;
    border-radius: 0.3rem;
    background: var(--color-primary);
    color: var(--color-light);
    border: none;
    cursor: pointer;
}

.btn-xs:hover {
    background: #1e39a0;
}

/* Clase para destacar textos urgentes (plazos críticos) */
.urgent {
    color: #d9534f;
    font-weight: 600;
}

/* Calendario mensual: cuadrícula de 7 columnas */
.calendar-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.calendar-cell {
    background: var(--color-light);
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    padding: 0.5rem;
    min-height: 80px;
    position: relative;
}

.calendar-cell .date-label {
    position: absolute;
    top: 0.2rem;
    right: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.calendar-cell ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
    font-size: 0.75rem;
}
.calendar-cell li {
    margin-bottom: 0.2rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.calendar-cell li.urgent {
    color: #d9534f;
}

/* Directorio: detalles */
#directoryDetail {
    margin-top: 1rem;
    background: var(--color-light);
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#directoryDetail h4 {
    margin-bottom: 0.5rem;
}

/* Chat list design */
.chat-users {
    background: var(--color-light);
    border-right: 1px solid #e2e8f0;
    border-radius: 0.5rem 0 0 0.5rem;
    padding: 0.5rem;
    overflow-y: auto;
}
.chat-users .chat-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.3rem;
    cursor: pointer;
}
.chat-users .chat-user:hover,
.chat-users .chat-user.active {
    background: var(--color-secondary);
}
.chat-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-user .chat-user-info {
    flex-grow: 1;
}
.chat-user .chat-user-info strong {
    font-size: 0.9rem;
    display: block;
}
.chat-user .chat-user-info small {
    font-size: 0.7rem;
    color: var(--color-muted);
}

/* Hide add office form outside settings */
.office-add-form {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    .dashboard {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar button {
        flex: 1 1 45%;
        margin: 0.3rem;
    }
}