/* ==========================================================
    LAS VARIABLES GENERALES SE DEFINEN EN public/css/app.css 
   ========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color var(--transition-normal),
        color var(--transition-normal), border-color var(--transition-normal),
        box-shadow var(--transition-normal);
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--line-height);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
    min-height: 100dvh;
}

/* Logo en esquina superior izquierda */
.logo-container {
    position: fixed;
    top: var(--space-lg);
    left: var(--space-lg);
    z-index: var(--z-fixed);
}

.logo {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: var(--border-width) solid var(--border-color);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.logo:hover {
    transform: var(--transform-hover-up);
    box-shadow: var(--shadow-xl);
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
}

/* Botón de tema en esquina superior derecha */
.theme-toggle-container {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-fixed);
}

.theme-toggle {
    background: var(--bg-secondary);
    border: var(--border-width) solid var(--border-color);
    color: var(--text-primary);
    padding: var(--padding-sm);
    border-radius: var(--border-radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-3xl);
    width: var(--button-size-lg);
    height: var(--button-size-lg);
    box-shadow: var(--shadow-lg);
}

.theme-toggle:hover {
    transform: var(--transform-hover-up);
    box-shadow: var(--shadow-xl);
    background: var(--bg-tertiary);
}

.theme-icon {
    transition: all var(--transition-normal);
    transform: var(--transform-rotate-0);
}

.theme-toggle.dark .theme-icon {
    transform: var(--transform-rotate-180);
}

.content-wrapper {
    max-width: 700px;
    width: 100%;
    max-height: 100%;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.title {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container-user {
    position: relative;
    width: 700px;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 16px 24px;
    font-size: var(--font-size-xl);
    border: var(--border-width-thick) solid var(--border-color);
    border-radius: var(--border-radius-pill);
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(56, 175, 66, 0.1), var(--shadow-xl);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: var(--font-weight-normal);
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-primary-simple);
    border: none;
    border-radius: var(--border-radius-xl);
    padding: 8px 16px;
    color: white;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-primary-btn);
}

.search-button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-50%) var(--transform-hover-up);
    box-shadow: var(--shadow-primary-hover);
}

.search-button:active {
    transform: translateY(-50%) scale(0.98);
}

/* Botones de filtro */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xs);
}

.filter-button {
    padding: var(--padding-md) var(--space-lg);
    border: var(--border-width-thick) solid var(--border-color);
    border-radius: var(--border-radius-pill);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
    user-select: none;
    box-shadow: var(--shadow-md);
}

.filter-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: var(--transform-hover-up);
    box-shadow: var(--shadow-lg);
}

.filter-button.active {
    border-color: var(--color-primary);
    background: var(--gradient-primary-simple);
    color: white;
    box-shadow: var(--shadow-primary-btn);
}

.filter-button.active:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: var(--shadow-primary-hover);
}

/* Botón "Leyes" */

#ley:hover {
    border-color: #1976D2;
    color: #1976D2;
    transform: var(--transform-hover-up);
    box-shadow: var(--shadow-lg);
}

#ley.active {
    border-color: #4498ec;
    background: var(--gradient-blue);
    color: white;
    box-shadow: var(--shadow-primary-btn);
}

#ley.active:hover {
    background: #1976D2;
    border-color: #1976D2;
    color: white;
    box-shadow: var(--shadow-primary-hover);
}

/* Botón "Decretos" */

#decreto:hover {
    border-color: #1976D2;
    color: #1976D2;
    transform: var(--transform-hover-up);
    box-shadow: var(--shadow-lg);
}

#decreto.active {
    border-color: #4498ec;
    background: var(--gradient-blue);
    color: white;
    box-shadow: var(--shadow-primary-btn);
}

#decreto.active:hover {
    background: #1976D2;
    border-color: #1976D2;
    color: white;
    box-shadow: var(--shadow-primary-hover);
}

/* Botón "Resoluciones" */

#resolucion:hover {
    border-color: #d21919;
    color: #d21919;
    transform: var(--transform-hover-up);
    box-shadow: var(--shadow-lg);
}

#resolucion.active {
    border-color: #ec4444;
    background: var(--gradient-red);
    color: white;
    box-shadow: var(--shadow-primary-btn);
}

#resolucion.active:hover {
    background: #d21919;
    border-color: #d21919;
    color: white;
    box-shadow: var(--shadow-primary-hover);
}

/* Botón "Directivas */

#directiva:hover {
    border-color: #8e19d2;
    color: #8e19d2;
    transform: var(--transform-hover-up);
    box-shadow: var(--shadow-lg);
}

#directiva.active {
    border-color: #8444ec;
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-primary-btn);
}

#directiva.active:hover {
    background: #8e19d2;
    border-color: #8e19d2;
    color: white;
    box-shadow: var(--shadow-primary-hover);
}
/* Indicador de selección */
.selection-indicator {
    margin-top: var(--space-xl);
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    min-height: 20px;
    font-weight: var(--font-weight-medium);
}

.selection-indicator.has-selection {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* Responsive */
@media (max-width: 768px) {
    .logo-container {
        top: var(--space-md);
        left: var(--space-md);
    }

    .theme-toggle-container {
        top: var(--space-md);
        right: var(--space-md);
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .logo img {
        width: 30px;
        height: 30px;
    }

    .theme-toggle {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-2xl);
    }

    .search-container-user {
        width: 100%;
    }

    .title {
        font-size: var(--font-size-4xl);
        margin-bottom: 2rem;
        margin-top: 3rem;
    }
    
    .search-button {
        padding: 6px 12px;
        font-size: var(--font-size-sm);
    }

    .filter-button {
        padding: var(--padding-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    .filter-container {
        gap: var(--space-sm);
    }

    .content-wrapper {
        margin-top: 60px;
    }    
}

@media (max-width: 480px) {
    .title {
        font-size: var(--font-size-3xl);
        margin-bottom: 1.5rem;
    }

    .filter-button {
        padding: var(--padding-xs) var(--space-sm);
        font-size: var(--font-size-xs);
    }
}

/* Animación sutil al cargar */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación para los botones */
.filter-button {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.filter-button:nth-child(1) {
    animation-delay: 0.1s;
}
.filter-button:nth-child(2) {
    animation-delay: 0.15s;
}
.filter-button:nth-child(3) {
    animation-delay: 0.2s;
}
.filter-button:nth-child(4) {
    animation-delay: 0.25s;
}
.filter-button:nth-child(5) {
    animation-delay: 0.3s;
}

/* Animación para logo y theme toggle */
.logo-container,
.theme-toggle-container {
    animation: fadeInDown 0.6s ease-out;
}


/* Grid de documentos ocupa todo el ancho y el scroll es de la página */
.documents-grid-user {
    display: flex;
    width: 100%;
    padding-right: 8px;
    padding-top: 30px;
    padding-bottom: 50px;
    box-sizing: border-box;
    border-radius: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* ← aquí el cambio */
    gap: 2rem;
    justify-content: center;
}

.content-wrapper {
    transition: margin-top 0.7s cubic-bezier(.4,0,.2,1);
    margin-top: 31vh;
}

.content-wrapper.move-up {
    margin-top: -14vh; /* Ajusta según tu preferencia */
}

@media (max-width: 1200px) {
    .documents-grid-user {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 700px) {
    .documents-grid-user {
        grid-template-columns: 1fr;
    }

    .content-wrapper.move-up {
    margin-top: 5vh; /* Ajusta según tu preferencia */
}
}
@media (min-width: 700px) {
    .documents-grid-user {
        padding-right: 8px;
    }
}


/* Pagination */

.pagination-btn {
    padding: var(--padding-sm) var(--space-md);
    border: var(--border-width) solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    min-width: var(--button-size-md);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: var(--transform-hover-up);
}

.pagination-btn:disabled {
    opacity: var(--opacity-text-muted);
    cursor: not-allowed;
    background: var(--bg-accent);
    color: var(--text-muted);
}

.pagination-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-primary-btn);
}

.pagination-controls {
    width: 100%;
    text-align: right;
    gap: var(--space-md);
}

.contenedor-pagination{
    width: 100%;
}

.filtro {
    display: flex;
    justify-content: left;
    align-items: center;
    min-height: 100%; /* Ejemplo */
}

.filtro-select {
    padding: var(--space-sm) var(--space-md);
    margin-left: 7px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xl);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    width: 35%;
    box-shadow: var(--shadow-filter);
    transition: all var(--transition-normal);
    appearance: none;
    /* Elimina el estilo nativo */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='70,100 100,50 40,50' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.filtro-select:focus {
    outline: none;
    background: var(--bg-accent);
    color: var(--color-primary);
}

/* Responsive para paginación */

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    .paginationNav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .pagination-btn {
        min-width: var(--button-size-sm);
        padding: var(--padding-xs) var(--space-sm);
        font-size: var(--font-size-sm);
    }
    .records-selector {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
    .pagination-controls {
        width: 100%;
        text-align: center;
    }
}

.highlight-name {
    color: var(--color-primary); /* Cambia este color por el que prefieras */
    font-weight: bold;
}

.nomenclatura-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.nomenclatura-item .document-icon {
    margin-right: 8px;
}

.nomenclatura-item span {
    text-align: left;
    flex: 1;
    /* Opcional: fuerza a ocupar el espacio restante */
}