:root {
    --bg-dark: #07070a;
    --surface: #121216;
    --surface-hover: #1c1c23;
    --primary: #8e2de2;
    --secondary: #4a00e0;
    --text-main: #f0f0f5;
    --text-muted: #9b9ba7;
    --border: rgba(255, 255, 255, 0.08);
    --ring: rgba(142, 45, 226, 0.4);
    --glass: rgba(18, 18, 22, 0.6);
    --radius: 12px;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Background Effects */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    top: -10%;
    left: 0%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary), transparent);
}

.orb-2 {
    bottom: 20%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--secondary), transparent);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 30%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, transparent, var(--bg-dark));
    opacity: 0.1;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* Base App Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    /* Base for absolute elements like .admin-access */
}

/* Typography & Hero */
.hero {
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 6rem;
    animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    animation: fadeInDown 1s ease-out;
}

.logo-img {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .logo-img {
        height: 80px;
    }
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.subtitle strong {
    color: var(--text-main);
}

.description {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(142, 45, 226, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(142, 45, 226, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Sections */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Gallery / Preview */
.preview-section {
    margin-bottom: 6rem;
}

.gallery-container {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gallery-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.3s;
}

.gallery-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.gallery-tab.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.gallery-content {
    border-radius: calc(var(--radius) - 4px);
    overflow: hidden;
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* Mantain ratio */
}

.gallery-view {
    display: none;
    width: 100%;
    height: 100%;
}

.gallery-view.active {
    display: block;
}

.gallery-images {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.gallery-img.active {
    opacity: 1;
    z-index: 2;
}

/* GIFs o imágenes más pequeñas: mostrar completas sin recortar */
.gallery-img--fit {
    object-fit: contain;
    background: #000;
}

/* Slider Controls */
.gallery-navbtn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.gallery-navbtn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.05);
}

.gallery-navbtn i {
    width: 22px;
    height: 22px;
}

.gallery-navbtn.prev {
    left: 1rem;
}

.gallery-navbtn.next {
    right: 1rem;
}

.gallery-indicators {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.gallery-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}


/* Profiles Layout Grid */
.profiles-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
}

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

.sidebar {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    align-self: start;
    position: sticky;
    top: 2rem;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-btn i {
    width: 18px;
    height: 18px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-btn.active {
    background: rgba(142, 45, 226, 0.15);
    color: #fff;
    font-weight: 600;
    border-left: 3px solid var(--primary);
    border-radius: 4px 8px 8px 4px;
    /* Straight edge on left line */
}

/* Accordion Component */
.accordion-group {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.accordion-group:hover {
    border-color: rgba(142, 45, 226, 0.3);
}

.accordion-header {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.2s;
    border-radius: var(--radius);
    font-family: inherit;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-title-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.accordion-title-icon i {
    color: var(--primary);
}

.accordion-chevron {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-muted);
}

.accordion-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Active State */
.accordion-group.active {
    border-color: var(--primary);
}

.accordion-group.active .accordion-header {
    background: rgba(142, 45, 226, 0.1);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-group.active .accordion-content {
    padding: 1.5rem;
    max-height: 2500px;
    opacity: 1;
}

.accordion-group.active .accordion-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Flat Grid (for non-accordion pages) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.profile-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-card:hover {
    transform: translateY(-5px);
    border-color: rgba(142, 45, 226, 0.3);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(142, 45, 226, 0.1);
}

.profile-card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.copy-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.copy-btn:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-access {
    position: fixed !important;
    top: 1.5rem !important;
    right: 2rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    z-index: 9999 !important;
    width: auto !important;
    left: auto !important;
}

.copy-btn.success {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}

/* Instructions Accordion */
.instructions-accordion {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.instructions-accordion:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-header-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.accordion-subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.accordion-chevron {
    color: var(--text-muted);
    transition: transform 0.3s ease, color 0.2s ease;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.accordion-header[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
    color: var(--primary-accent);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 2rem;
}

.accordion-body.open {
    max-height: 5000px;
    /* Suficiente para contenido largo de markdown */
    padding: 0 2rem 2rem;
}

/* Markdown Body Styles */

.markdown-body {
    color: var(--text);
    line-height: 1.6;
    font-size: 0.95rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.markdown-body h1 {
    font-size: 1.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.markdown-body h2 {
    font-size: 1.5rem;
}

.markdown-body h3 {
    font-size: 1.25rem;
}

.markdown-body p {
    margin-bottom: 1.25rem;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--primary-accent);
}

.markdown-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.5rem 1rem;
    margin: 1.5rem 0;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

.markdown-body hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

.lang-switcher {
    display: flex;
    align-items: center;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.admin-link i {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.lang-btn i {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
}

.toast {
    background: var(--surface);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 250px;
    animation: slideIn 0.3s ease-out forwards;
}

.toast.success {
    border-left-color: #2ecc71;
}

.toast.error {
    border-left-color: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

footer {
    border-top: 1px solid var(--border);
    margin-top: 6rem;
    padding-top: 2rem;
    margin-bottom: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1rem;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Downloads Section */
.copy-btn.download-style {
    background: var(--primary-accent);
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.copy-btn.download-style i {
    color: #fff !important;
}

.copy-btn.download-style:hover {
    background: #7c3aed;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Admin Visibility Toggle Colors */
.btn-action.active i {
    color: #2ecc71;
}

.btn-action.inactive i {
    color: #e74c3c;
}

.btn-action:hover i {
    filter: brightness(1.2);
}

/* Admin CRUD UI refinements */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.modal-section-title {
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.form-group select {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-main) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    transition: 0.3s !important;
    outline: none !important;
    appearance: none !important;
}

.form-group select:focus {
    border-color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.form-group select option {
    background: #111;
    color: #fff;
}