/* ============================================= */
/* VARIABLES CSS GLOBALES */
/* ============================================= */

:root,
body.theme-light {
    /* Tema claro (por defecto) */
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;

    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-modal: #ffffff;

    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-title: rgb(73, 74, 74);

    --border-color: #dee2e6;
    --border-radius: 12px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

    --hover-overlay: rgba(0, 0, 0, 0.05);
    --focus-ring: rgba(67, 97, 238, 0.3);
    /* Navbar específico */
    --nav-bg: #212529;
    --nav-text: #ffffff;

    /*CRUD*/
    /* Colores principales */
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;

    /* Colores CRUD */
    --edit-color: #17a2b8;
    --edit-color-dark: #138496;
    --edit-color-darker: #117a8b;

    --danger-color: #dc3545;
    --danger-color-dark: #c82333;
    --danger-color-darker: #bd2130;

    --warning-color: #ffa807;




}

body.theme-dark {
    /* Tema oscuro */
    --primary-color: #5a75f1;
    --secondary-color: #4a65e1;
    --accent-color: #ff4d94;

    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --bg-modal: #121212;

    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #6c757d;

    --border-color: #626161;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --hover-overlay: rgba(255, 255, 255, 0.1);
    --focus-ring: rgba(90, 117, 241, 0.4);

    --nav-bg: #1a1a1a;
    --nav-text: #ffffff;

    /*CRUD*/
    --primary-color: #5a75f1;
    --secondary-color: #4a65e1;

    --edit-color: #0dcaf0;
    --edit-color-dark: #0ba5c7;
    --edit-color-darker: #0989a9;

    --danger-color: #ff6b6b;
    --danger-color-dark: #ee5e5e;
    --danger-color-darker: #dd5151;

    --warning-color: #b17405;


}

body.theme-blue {
    /* Tema azul */
    --primary-color: #2196f3;
    --secondary-color: #1976d2;
    --accent-color: #ff4081;

    --bg-primary: #e3f2fd;
    --bg-secondary: #ebeff3;
    --bg-tertiary: #90caf9;
    --bg-modal: #ffffff;

    --text-primary: #3e3e3e;
    --text-secondary: #5c5d5e;
    --text-muted: #5d99c6;

    --border-color: #dee2e6;

    --shadow-sm: 0 2px 8px rgba(33, 150, 243, 0.1);
    --shadow-md: 0 4px 16px rgba(33, 150, 243, 0.15);
    --shadow-lg: 0 8px 32px rgba(33, 150, 243, 0.2);

    --hover-overlay: rgba(33, 150, 243, 0.1);
    --focus-ring: rgba(33, 150, 243, 0.3);

    --nav-bg: #1565c0;
    --nav-text: #ffffff;

    /*CRUD*/

    --primary-color: #2196f3;
    --secondary-color: #1976d2;

    --edit-color: #0dcaf0;
    --edit-color-dark: #0ba5c7;
    --edit-color-darker: #0989a9;

    --danger-color: #f44336;
    --danger-color-dark: #e53935;
    --danger-color-darker: #d32f2f;

    --warning-color: #fbb32f;

}

/* ============================================= */
/* ESTILOS BASE */
/* ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 70px;
    /* Para el navbar fijo */
}

/* ============================================= */
/* COMPONENTES QUE USAN VARIABLES */
/* ============================================= */

/* Navbar */
.nav-color {
    background-color: var(--nav-bg) !important;
}

.navbar-title {
    color: var(--nav-text) !important;
}

.icon-menu {
    width: 28px;
    height: 28px;
}

.menu {
    display: flex;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.8s ease;
}

.menu-title {
    padding-left: 10px;
    font-size: 1.2rem;
    color: white;
}

/* Botones de tema */
.btn-theme {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: var(--bg-secondary); */
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 8px;
}

.btn-theme:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.btn-theme.active {
    /* background: var(--primary-color); */
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.theme-selector {
    min-width: 180px;
}

/* Offcanvas */
.menu-lateral {
    background-color: var(--nav-bg) !important;
    color: var(--nav-text) !important;
}

.offcanvas-header-custom {
    border-bottom: 1px solid var(--border-color);
}

.offcanvas-body-custom {
    background-color: var(--nav-bg);
}

/* Contenedor principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 40px;
    position: relative;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    opacity: 0.8;
}

.main-title {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 25px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.search-box {
    flex-grow: 1;
    max-width: 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Article Cards */
.article-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.article-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-header {
    padding: 28px 28px 20px;
    position: relative;
    background-color: var(--bg-secondary);
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.3;
}

.card-content {
    padding: 0 28px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
}

.card-excerpt {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.7;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.card-date {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.card-date i {
    color: var(--text-secondary);
}

.card-footer {
    padding: 0 28px 28px;
    background-color: var(--bg-secondary);
}

.read-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.read-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
    gap: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 60px;
    flex-wrap: wrap;
}

.page-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.page-btn:hover,
.page-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    background-color: var(--border-color);
}



#btn-offcanvas {
    transition: transform 0.25s ease;
}

.btn-offcanvas-open {
    transform: translateX(240px);
}

.menu-lateral {
    top: 55px !important;
    width: 250px !important;
}

/* ============================================= */
/* ESTILOS PARA EL SISTEMA DE RESALTADO */
/* ============================================= */

.article {
    max-width: 800px;
    margin: 80px auto 40px;
    padding: 40px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
}

.article h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
    line-height: 1.3;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Botón de activar/desactivar resaltado */
.toggle-highlight {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--bg-primary);
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.toggle-highlight:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.toggle-highlight.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Contenedor de texto */
.text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 40px;
    padding: 25px;
    padding-top: 0px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    min-height: 200px;
    transition: all 0.3s ease;
    user-select: none;
}

.text.disable {
    opacity: 0.7;
    background: var(--bg-tertiary);
}

/* Palabras individuales */
.word {
    transition: all 0.2s ease;
    padding: 2px 4px;
    /* border-radius: 4px; */
    /* margin: 0 1px; */
    position: relative;
    cursor: pointer;
}

.word:hover {
    background: var(--hover-overlay);
    transform: translateY(-1px);
}

/* Resaltado activo */
.word.active {
    background: linear-gradient(120deg,
            rgba(67, 97, 238, 0.15),
            rgba(103, 58, 183, 0.15));
    color: var(--primary-color);
    /* font-weight: 600; */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    
}

/* Efecto especial para la última palabra resaltada */
.word.active:last-of-type {
    background: linear-gradient(120deg,
            rgba(67, 97, 238, 0.25),
            rgba(103, 58, 183, 0.25));
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
    position: relative;
    
}

.word.active:last-of-type::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Controles */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 30px;
}

.controls button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.controls button:active {
    transform: translateY(0);
}

.controls .info {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Indicador de progreso */
.progress-indicator {
    margin-top: 20px;
    display: none;
}

.progress-indicator.visible {
    display: block;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Indicador visual de palabra actual */
.current-word-marker {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 1000;
    min-width: 200px;
}

.current-word-marker.visible {
    display: block;
}

.marker-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.marker-word {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    word-break: break-word;
}

/* Estados específicos por tema */
body.theme-dark .word.active {
    background: linear-gradient(120deg,
            rgba(90, 117, 241, 0.25),
            rgba(159, 122, 234, 0.25));
    color: #a3b4ff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.theme-blue .word.active {
    background: linear-gradient(120deg,
            rgba(33, 150, 243, 0.2),
            rgba(66, 165, 245, 0.2));
    color: #1565c0;
}

/* Efecto de brillo en palabras activas */
.word.active {
    position: relative;
    z-index: 1;
}
.word.active.last{
  text-decoration: underline ;  
}

/* .word.active:hover::before {
    opacity: 0.4;
} */

/* Responsive para móviles */


/* Animación suave para cambios de tema */
.word,
.text,
.article,
.toggle-highlight,
.controls {
    transition: background-color 0.5s ease,
        color 0.5s ease,
        border-color 0.5s ease,
        box-shadow 0.5s ease;
}



/* Botón flotante */
.btn-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-float:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}




/*=======================================================================*/
/*==============================CRUD Actions==========================*/
/*=======================================================================*/


/* ============================================= */
/* ESTILOS PARA ARTÍCULOS SIMPLIFICADOS */
/* ============================================= */

.article-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-header {
    padding: 24px 24px 16px;
    position: relative;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content {
    padding: 16px 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
}

.card-excerpt {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 80px;
}

.card-meta {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.card-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.card-date i {
    color: var(--text-secondaryr);
    font-size: 0.9rem;
}

.card-footer {
    padding: 16px 24px 24px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* ============================================= */
/* ESTILOS PARA BOTONES SIMPLIFICADOS */
/* ============================================= */

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* flex-wrap: wrap; */
    gap: 15px;
    width: 100%;
}

/* Botón Leer Completo */
.read-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-grow: 1;
    justify-content: center;
    max-width: 180px;
    font-size: 0.95rem;
}

.read-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--focus-ring);
}

.read-btn i {
    font-size: 1rem;
}

/* Contenedor de botones CRUD */
.card-actions {
    display: flex;
    gap: 10px;
}

/* Botones CRUD base */
.btn-crud {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-crud:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Botón Editar con variables de tema */
.btn-edit-crud {
    background: linear-gradient(135deg, var(--edit-color), var(--edit-color-dark));
    color: white;
    border: 2px solid var(--edit-color);
}

.btn-edit-crud:hover {
    background: linear-gradient(135deg, var(--edit-color-dark), var(--edit-color-darker));
    border-color: var(--edit-color-dark);
}

/* Botón Eliminar con variables de tema */
.btn-delete-crud {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-color-dark));
    color: white;
    border: 2px solid var(--danger-color);
}

.btn-delete-crud:hover {
    background: linear-gradient(135deg, var(--danger-color-dark), var(--danger-color-darker));
    border-color: var(--danger-color-dark);
}

/* Efecto de brillo */
.btn-crud::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-crud:hover::before {
    left: 100%;
}

/* Etiquetas de botones */
.btn-label {
    transition: opacity 0.3s ease;
}

/* Íconos en botones */
.btn-crud i {
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

.btn-crud:hover i {
    transform: scale(1.1);
}

.icon-dashboard {
    color: var(--warning-color);
}


/* ============================================= */
/* ANIMACIONES */
/* ============================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--card-index) * 0.1s);
    opacity: 0;
}

.card-actions {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}




.modal-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.4rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

.btn-close {
    filter: invert(0.5);
}

.btn-mark {
    border-radius: 0px 0px 5px 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    color: white;
    border: none;
    padding: 10px 15px;
}

.btn-mark-used {
    background-color: var(--primary-color);
}

.btn-mark-used:hover {
    transform: translateY(-2px);
}

.btn-used {
    background-color: var(--text-muted);
}

.btn-used:hover {
    transform: translateY(-2px);

}

.modal-body,
.modal-header,
.modal-footer {
    background: var(--bg-modal);
}

#titleUpdate,
#contentUpdate,
#dateUpdate {
    background-color: var(--bg-modal);
    color: var(--text-primary);
}

#titleUpdate::placeholder,
#contentUpdate::placeholder,
#dateUpdate::placeholder {
    color: var(--text-secondary);
}

#titleAdd,
#contentAdd,
#dateAdd {
    background-color: var(--bg-modal);
    color: var(--text-primary);
}

#titleAdd::placeholder,
#contentAdd::placeholder,
#dateAdd::placeholder {
    color: var(--text-secondary);
}

/* ============================================= */
/* RESPONSIVE*/
/* ============================================= */

@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 25px;
    }
    .article h1{
                padding-right: 20px;
    }
}

@media (max-width: 992px) {
    .main-title {
        font-size: 2.8rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .card-title {
        font-size: 1.5rem;
    }
}


@media (max-width: 768px) {

    /* ===== GRID Y TÍTULOS ===== */
    .articles-grid {
        grid-template-columns: 1fr;
        /* max-width: 600px; */
        /* margin-left: auto;
        margin-right: auto; */
    }

    .main-title {
        font-size: 2.4rem;
    }

    .main-subtitle {
        font-size: 1.1rem;
        padding: 0 15px;
    }

    /* ===== TARJETAS GENERALES ===== */
    .article-card {
        margin: 0px;
    }

    .card-header,
    .card-content,
    .card-footer {
        padding: 20px;
    }

    .card-header {
        padding-top: 25px;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-excerpt {
        -webkit-line-clamp: 3;
        min-height: 72px;
    }

    /* ===== ARTÍCULO ===== */
    .article {
        margin: 60px 10px 30px;
        padding: 10px;
    }

    .article h1 {
        font-size: 2rem;
        padding-right: 70px;
    }

    .text {
        font-size: 1.1rem;
        padding: 20px;
        padding-top: 0px;

    }

    /* ===== BOTÓN FLOTANTE ===== */
    .btn-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }



    /* ===== CONTROLES ===== */
    .controls {
        flex-direction: column;
        gap: 15px;
    }

    .controls button {
        width: 100%;
        justify-content: center;
    }

    /* ===== FOOTER CARD ===== */
    .footer-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .read-btn {
        max-width: 100%;
        order: 2;
    }

    .footer-actions {
        order: 1;
        justify-content: center;
        margin-bottom: 10px;
    }

    .card-actions {
        width: 100%;
        justify-content: center;
    }

    /* ===== BOTONES CRUD (solo iconos) ===== */
    .btn-label {
        display: none;
    }

    .btn-crud {
        min-width: auto;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        justify-content: center;
        padding: 0;
    }

    .btn-crud i {
        font-size: 1.1rem;
        margin: 0;
    }

    /* Mantener texto en botón leer */
    .read-btn .btn-label {
        display: inline;
    }

}

.btn-add-crud {
    background: var(--primary-color);
    color: white;
}

.btn-add-crud:hover {
    background: var(--secondary-color);
    color: white;
}

@media (max-width: 576px) {
    body {
        padding: 15px;
        padding-top: 60px;
    }

    .main-title {
        font-size: 2rem;
    }

    .main-subtitle {
        font-size: 1rem;
    }

    .controls {
        padding: 20px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .card-excerpt {
        -webkit-line-clamp: 5;
    }

    .article {
        margin: 30px 0px 30px;
        padding: 10px;
    }

        /* ===== BOTÓN RESALTAR ===== */
    .toggle-highlight {
        width: 45px;
        height: 45px;
        top: auto;
        left: 20px;
        margin-top: 10px;

    }
        .article h1 {
        font-size: 2rem;
        padding-right: 0px;
    }
}


@media (max-width: 480px) {
    .card-title {
        font-size: 1.2rem;
    }

    .card-excerpt {
        font-size: 0.95rem;
        -webkit-line-clamp: 4;
    }

    .btn-crud {
        width: 44px;
        height: 44px;
    }

    .container {
        padding: 20px 0px;
    }
}



.alert {
    background: var(--bg-secondary);
    color: var(--warning-color);

}



/* ============================================= */
/* ESTILOS PARA NOTIFICACIONES */
/* ============================================= */

.notification-container {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 1056;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: notification-slide-in 0.3s ease;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.notification-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notification-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-slide-out {
    animation: notification-slide-out 0.3s ease forwards;
}

.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

@keyframes notification-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notification-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .notification-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .notification {
        padding: 14px 16px;
    }
}





.text-header {
    display: flex;
    width: 100%;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
a{
    text-decoration: none;
    color: inherit;
}