/* Estilos generales y fondo con imagen y degradado institucional */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgba(122, 18, 35, 0.88), rgba(40, 5, 10, 0.92)), url('../imagenes/doc138.png') no-repeat center center fixed;
    background-size: cover;
    color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/* Estilos individuales del Header */
header.header-container {
    background-color: rgba(122, 18, 35, 0.95);
    border-bottom: 4px solid #D4AF37;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    box-sizing: border-box;
}
.header-logo {
    width: 110px;
    height: auto;
    flex-shrink: 0;
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 900px;
}
h1 {
    color: #D4AF37;
    font-size: 2.8rem;
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}
header p {
    color: #ffffff;
    font-size: 1.15rem;
    max-width: 800px;
    margin: 0;
    line-height: 1.6;
}
/* Estilos individuales del Nav y Animación simple */
nav {
    background-color: #2c1a1d;
    padding: 0.8rem 0;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}
ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 0;
    padding: 0;
}
li {
    display: inline-block;
}
a.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}
/* Animación simple en el NAV */
a.nav-link:hover {
    color: #D4AF37;
    background-color: rgba(212, 175, 55, 0.15);
    transform: translateY(-3px) scale(1.05);
}
/* Sección superior de destacados */
.highlight-section {
    padding: 1.5rem 1.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}
.highlight-banner {
    background: linear-gradient(90deg, rgba(122, 18, 35, 0.95), rgba(212, 175, 55, 0.95));
    color: #ffffff;
    padding: 0.8rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}
.highlight-banner span {
    display: inline-block;
    font-weight: 600;
}
.lema-ie {
    width: 100%;
    max-width: 900px;
    margin: 10px auto 1rem;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(122, 18, 35, 0.78);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(212, 175, 55, 0.35);
    backdrop-filter: blur(10px);
}
.lema-contenido {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
    padding: 12px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    animation: deslizar 18s linear infinite;
}
.lema-contenido strong {
    color: #D4AF37;
    font-size: 15.5px;
    letter-spacing: 1px;
}
.lema-contenido em {
    font-style: italic;
    opacity: 0.92;
    color: #f3f0e8;
}
.lema-separador {
    color: #D4AF37;
    font-size: 18px;
}
.lema-icono {
    color: #D4AF37;
    font-size: 13px;
}
@keyframes deslizar {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}
@media (max-width: 600px) {
    .lema-ie {
        max-width: 95%;
    }
    .lema-contenido {
        font-size: 12px;
        gap: 8px;
        padding: 8px 0;
    }
    .lema-contenido strong {
        font-size: 13px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .lema-contenido {
        animation: none;
        display: flex;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
}
.highlight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 1100px;
    width: 100%;
}
.highlight-card {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(212, 175, 55, 0.85);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}
.highlight-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}
.highlight-card h3 {
    margin: 0;
    color: #f7d96a;
    font-size: 1.05rem;
    line-height: 1.2;
}
.highlight-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.highlight-card p {
    margin: 0;
    color: #f7f7f7;
    font-size: 0.94rem;
    line-height: 1.5;
}
.card-link-block {
    display: block;
    color: inherit;
    text-decoration: none;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.secondary-section {
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}
.secondary-banner {
    background: linear-gradient(90deg, rgba(110, 25, 25, 0.95), rgba(40, 95, 90, 0.95));
}
.secondary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.secondary-card {
    min-height: 180px;
}
.section-container {
    padding: 2rem 1.25rem 3rem;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    max-width: 1100px;
    width: 100%;
    align-items: start;
}
.resource-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    padding-right: 1rem;
}
.resource-column + .resource-column {
    padding-left: 1rem;
    border-left: 2px solid rgba(212, 175, 55, 0.55);
    box-shadow: -8px 0 0 rgba(255, 255, 255, 0.03);
}
.level-title {
    margin: 0;
    color: #D4AF37;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.resource-column-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}
/* Grid especial para secundaria con 4 cards */
.resource-column-grid.secondary-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.resource-card {
    background: rgba(255, 255, 255, 0.12);
    border: 3px solid #D4AF37;
    border-radius: 16px;
    padding: 0.9rem;
    backdrop-filter: blur(6px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.22);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 180px;
}
.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.85rem;
}
.card-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #f3f0e8;
}
.card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.resource-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.6;
}
.footer-container {
    background: rgba(18, 12, 17, 0.8);
    padding: 1rem 1.25rem 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}
.social-wrapper {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(212, 175, 55, 0.16);
    transition: transform 0.2s ease, background 0.2s ease;
}
.social-link:hover {
    transform: translateY(-2px);
    background: rgba(212, 175, 55, 0.35);
}
.copy-text {
    color: #d9d4c4;
    margin: 0;
    font-size: 0.95rem;
}

/* Estilos para modo administrador */
.admin-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: center;
    gap: 10px;
    position: static;
    flex: 0 0 300px;
    z-index: 100;
}

.admin-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.admin-actions:not(.is-visible) {
    display: none;
}

.role-badge {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.2);
    color: #D4AF37;
    border: 1px solid rgba(212, 175, 55, 0.4);
    font-weight: 600;
}

.role-badge.admin {
    background: rgba(212, 175, 55, 0.3);
    color: #f7d96a;
    border-color: #D4AF37;
    font-weight: 600;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

@media (max-width: 900px) {
    header.header-container {
        flex-wrap: wrap;
    }

    .header-content {
        min-width: min(100%, 500px);
    }

    .admin-controls {
        flex: 1 1 100%;
        width: min(100%, 500px);
    }
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: #D4AF37;
    color: #1a1a1a;
}

.btn-primary:hover {
    background: #f7d96a;
}

.btn-outline {
    background: transparent;
    color: #D4AF37;
    border: 1.5px solid #D4AF37;
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* Controles de administración en cards */
.admin-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.mini-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(0, 0, 0, 0.3);
    color: #D4AF37;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mini-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #f7d96a;
    transform: scale(1.1);
}

.mini-btn.danger:hover {
    background: rgba(220, 38, 38, 0.3);
    border-color: #dc2626;
    color: #dc2626;
}

.move-pad {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    gap: 2px;
    z-index: 10;
}

.move-pad button {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(0, 0, 0, 0.3);
    color: #D4AF37;
    font-size: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.move-pad button:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.1);
}

.move-pad button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Estilos para cards arrastrables en modo admin */
.highlight-card.dragging,
.resource-card.dragging {
    opacity: 0.5;
    border: 2px dashed #D4AF37;
}

.highlight-card.drag-over,
.resource-card.drag-over {
    border: 2px solid #D4AF37;
    transform: scale(1.02);
}

.icon-selector-wrapper {
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    padding: 12px;
}

.icon-selector-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.icon-selector-toolbar input,
.icon-selector-toolbar select {
    flex: 1;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);
    color: #f8f5ee;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
}

.icon-selector-toolbar input:focus,
.icon-selector-toolbar select:focus {
    outline: none;
    border-color: #D4AF37;
}

.icon-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 4px;
}

.svg-icon-option {
    border: 1.5px solid rgba(212, 175, 55, 0.25);
    background: rgba(212, 175, 55, 0.05);
    color: #f5f3ee;
    border-radius: 10px;
    padding: 8px 6px 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    text-align: center;
    min-height: 92px;
}

.svg-icon-option:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.75);
    background: rgba(212, 175, 55, 0.1);
}

.svg-icon-option.selected {
    border-color: #D4AF37;
    background: rgba(212, 175, 55, 0.18);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35);
}

.svg-icon-preview {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.svg-icon-option span {
    font-size: 11px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
}

.icon-selector-empty {
    padding: 14px 10px;
    border-radius: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    border: 1px dashed rgba(212, 175, 55, 0.5);
    font-size: 12px;
}

.icon-selection {
    margin-top: 8px;
    font-size: 11px;
    color: #f7d96a;
    min-height: 16px;
}

/* Modal de edición */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.open {
    display: flex;
}

.modal {
    background: rgba(30, 15, 20, 0.95);
    border-radius: 16px;
    padding: 24px;
    width: 720px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.modal h3 {
    margin: 0 0 4px;
    color: #D4AF37;
    font-size: 18px;
}

.modal .modal-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #D4AF37;
    margin-bottom: 5px;
}

.field input[type="text"],
.field textarea {
    width: 100%;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    resize: vertical;
}

.field textarea {
    min-height: 80px;
}

.custom-icon-field {
    min-height: 90px;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: #D4AF37;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.move-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.move-menu-button {
    width: 100%;
    text-align: left;
}

.move-menu-modal {
    width: 300px;
}

/* Toast de notificaciones */
.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(122, 18, 35, 0.95);
    color: #fff;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Posicionamiento relativo para cards en modo admin */
.highlight-card,
.resource-card {
    position: relative;
}