/* Auth / Security Gate Modal */
.auth-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.hidden {
    display: none;
}

.auth-card {
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.auth-header .lock-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.auth-header h2 {
    font-family: var(--font-mono);
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--muted-color);
    margin-bottom: 1.5rem;
}

.auth-error {
    background: rgba(255, 50, 50, 0.15);
    border: 1px solid #ff4d4d;
    color: #ff8080;
    padding: 0.6rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.auth-error.hidden { display: none; }

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

.btn-logout {
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 50, 50, 0.4);
    color: #ff8080;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 50, 50, 0.25);
    color: #fff;
    border-color: #ff4d4d;
}

/* Admin Dashboard Styling */

.admin-header {
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding: 1rem 2rem;
    backdrop-filter: blur(10px);
}

.admin-nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 0.25rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

.admin-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.badge-admin {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.system-status {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 255, 65, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.admin-container {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    border-color: rgba(0, 255, 65, 0.4);
    transform: translateY(-2px);
}

.stat-card.highlight {
    border-color: var(--secondary-color);
    background: rgba(0, 255, 255, 0.04);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card.highlight .stat-value {
    color: var(--secondary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted-color);
    font-family: var(--font-mono);
    margin-top: 0.3rem;
}

/* Notifications */
.notification {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.notification.success {
    background: rgba(0, 255, 65, 0.15);
    border-color: var(--primary-color);
    color: #a3ffb8;
}

.notification.error {
    background: rgba(255, 50, 50, 0.15);
    border-color: #ff3232;
    color: #ff9e9e;
}

.notification.hidden {
    display: none;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    margin-bottom: 2rem;
}

.admin-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: var(--muted-color);
    padding: 0.8rem 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-tab:hover {
    color: var(--text-color);
    background: rgba(0, 255, 65, 0.05);
}

.admin-tab.active {
    color: var(--primary-color);
    background: var(--surface-color);
    border-color: var(--primary-color);
    border-bottom: 2px solid var(--bg-color);
    margin-bottom: -1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Editor Layout (Form + Live Preview) */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Quick Category Picker */
.quick-category-picker {
    margin-bottom: 1.5rem;
}

.field-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted-color);
    margin-bottom: 0.4rem;
}

.field-label .required {
    color: #ff4d4d;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.chip.active {
    background: rgba(0, 255, 65, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Form inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.flex-1 { flex: 1; }

input[type="text"], textarea, select {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.2);
}

/* Accordion */
.advanced-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.advanced-summary {
    padding: 0.8rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--secondary-color);
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.02);
}

.advanced-body {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #000;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #00cc34;
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-family: var(--font-mono);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-secondary.hidden { display: none; }

/* Table Section */
.manage-panel {
    background: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
}

.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0 1rem;
}

.search-box .prompt {
    color: var(--primary-color);
    font-family: var(--font-mono);
    margin-right: 0.5rem;
}

.search-box input {
    border: none;
    background: transparent;
    padding: 0.75rem 0;
}

.search-box input:focus {
    box-shadow: none;
}

.filter-category-select select {
    min-width: 200px;
}

.table-responsive {
    overflow-x: auto;
}

.terms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.terms-table th, .terms-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terms-table th {
    font-family: var(--font-mono);
    color: var(--primary-color);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.4);
}

.terms-table tr:hover {
    background: rgba(0, 255, 65, 0.03);
}

.badge-cat {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: rgba(0, 255, 255, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.badge-cat.momento-hacker {
    background: rgba(0, 255, 65, 0.1);
    color: var(--primary-color);
    border-color: rgba(0, 255, 65, 0.3);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-icon.edit:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-icon.delete:hover {
    border-color: #ff4d4d;
    color: #ff4d4d;
}

.text-center { text-align: center; }

/* Adaptación Responsiva para Administración en Móviles */
@media (max-width: 768px) {
    .admin-header {
        padding: 0.75rem 1rem;
    }

    .admin-nav-container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .admin-container {
        padding: 0 0.75rem;
        margin: 1rem auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .admin-tabs {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .admin-tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.75rem;
        width: 100%;
        text-align: center;
    }

    .editor-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-filter-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-category-select select {
        width: 100%;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
        max-width: 95%;
    }

    .auth-header h2 {
        font-size: 1.1rem;
    }
}
