/* =========================================
   1. ESTILOS ESPECÍFICOS DE ARTÍCULOS
   ========================================= */
.article-hero {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
    padding: 8rem 5% 4rem;
    margin-bottom: 3rem;
    overflow: hidden;
}

.article-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    transform: scale(1.05);
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(to bottom, rgba(5, 5, 10, 0.2) 0%, rgba(5, 5, 10, 0.8) 50%, var(--bg-dark) 100%);
}

.article-hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.article-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.article-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.article-meta .author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
}

.article-meta .author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
}

.article-meta .dot {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
}

/* =========================================
   4. ARTICLE LAYOUT & SIDEBARS
   ========================================= */
.article-layout {
    display: flex;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 5% 5rem;
    gap: 3rem;
    position: relative;
    align-items: flex-start;
    justify-content: center;
}

/* Sidebar de Acciones (Izquierda - PC) */
.article-sidebar {
    position: sticky;
    top: 120px;
    width: 60px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0;
    -webkit-user-select: none;
    user-select: none;
}

.action-btn>svg:not(.progress-ring) {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.3s;
}

.btn-bookmark.saved {
    color: var(--accent-gold);
    border-color: rgba(245, 166, 35, 0.3);
    background: rgba(245, 166, 35, 0.1);
}

.btn-bookmark.saved svg {
    fill: var(--accent-gold);
    stroke: var(--accent-gold);
}

.btn-audio {
    color: var(--accent-blue);
    border-color: rgba(0, 229, 255, 0.3);
    background: rgba(0, 229, 255, 0.05);
}

.btn-audio svg {
    fill: currentColor;
    stroke: none;
}

/* ULTRA PRO: AMBIENT PROGRESS RING */
.share-with-progress {
    position: relative;
    background: transparent !important;
    border: none !important;
    overflow: visible;
}

.share-with-progress .progress-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
    z-index: 0;
}

.share-with-progress .progress-ring-bg {
    fill: var(--glass-bg);
    stroke: var(--glass-border);
    stroke-width: 4;
    transition: var(--transition-smooth);
}

.share-with-progress .progress-ring-circle {
    fill: transparent;
    stroke: var(--accent-blue);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
    filter: drop-shadow(0 0 5px var(--accent-blue-glow));
    will-change: stroke-dashoffset;
}

.share-with-progress svg:not(.progress-ring) {
    position: relative;
    z-index: 1;
}

/* Contenedor Central */
.article-body-wrapper {
    flex-grow: 1;
    max-width: 750px;
    width: 100%;
}

/* =========================================
   5. ULTRA PRO: TABLE OF CONTENTS (TOC)
   ========================================= */
.article-toc-sidebar {
    position: sticky;
    top: 120px;
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.toc-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: block;
}

.toc-nav ul {
    list-style: none;
    border-left: 2px solid var(--glass-border);
    padding-left: 0;
}

.toc-nav li {
    position: relative;
    margin-bottom: 1.2rem;
}

.toc-nav a {
    display: block;
    padding-left: 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.toc-nav a.active {
    color: var(--accent-blue);
    font-weight: 600;
}

.toc-nav a.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue-glow);
    border-radius: 2px;
    transition: height 0.3s ease;
}

/* Mobile TOC */
.mobile-toc-container {
    display: none;
    width: 100%;
    margin-bottom: 3rem;
}

.mobile-toc-details {
    background: rgba(5, 5, 10, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.mobile-toc-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.05rem;
}

.mobile-toc-summary::-webkit-details-marker {
    display: none;
}

.mobile-toc-summary svg {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-toc-details[open] .mobile-toc-summary svg {
    transform: rotate(180deg);
    color: var(--accent-blue);
}

.mobile-toc-nav {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

@media (max-width: 1150px) {
    .article-toc-sidebar {
        display: none;
    }

    .mobile-toc-container {
        display: block;
    }
}

/* =========================================
   6. ARTICLE CONTENT (TYPOGRAPHY)
   ========================================= */
.article-body {
    width: 100%;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-article);
}

.article-body p {
    margin-bottom: 2rem;
}

.article-body h2 {
    font-size: 2rem;
    color: #fff;
    margin: 3.5rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    scroll-margin-top: 120px;
}

.article-body strong {
    color: #fff;
    font-weight: 600;
}

.tech-spec-box {
    background: rgba(5, 5, 10, 0.6);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-blue);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.tech-spec-box strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.variant-list {
    list-style: none;
    margin-bottom: 2rem;
}

.variant-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.variant-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-gold);
    font-size: 1.5rem;
    line-height: 1;
}

/* =========================================
   7. MOBILE BOTTOM ACTION BAR
   ========================================= */
.mobile-action-bar {
    display: none;
}

@media (max-width: 992px) {
    .article-layout {
        padding: 0 5% 7rem;
        flex-direction: column;
        gap: 0;
    }

    .article-sidebar {
        display: none;
    }

    .article-body {
        font-size: 1.1rem;
    }

    .article-hero {
        min-height: 50vh;
        padding-top: 7rem;
    }

    .mobile-action-bar {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%) translateZ(0);
        width: 90%;
        max-width: 400px;
        background: rgba(5, 5, 10, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-pill);
        padding: 0.5rem 1.5rem;
        justify-content: space-between;
        align-items: center;
        z-index: 1000;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .mobile-action-bar .action-btn {
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        padding: 0;
        display: flex;
    }

    #ai-audio-player {
        bottom: 85px !important;
    }
}

/* =========================================
   8. AUDIO PLAYER & UTILS
   ========================================= */
#ai-audio-player {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 350px;
    max-width: 90%;
    background: rgba(5, 5, 10, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-pill);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, visibility 0.4s;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px var(--accent-blue-glow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px);
    will-change: transform, opacity;
}

#ai-audio-player.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.player-controls {
    display: flex;
    align-items: center;
}

.btn-player {
    background: var(--accent-blue);
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
}

.btn-player svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-close-player {
    background: transparent;
    color: var(--text-muted);
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.3s;
    padding: 0;
    text-transform: none;
}

.player-info {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player-title {
    font-size: 0.85rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.equalizer {
    display: flex;
    gap: 3px;
    height: 15px;
    align-items: flex-end;
}

.eq-bar {
    width: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
    height: 15px;
    transform-origin: bottom;
    transform: scaleY(0.2);
    transition: transform 0.2s ease;
    will-change: transform;
}

#ai-audio-player.playing .eq-bar {
    animation: eq-bounce 0.5s infinite alternate ease-in-out;
}

@keyframes eq-bounce {
    0% { transform: scaleY(0.2); }
    100% { transform: scaleY(1); }
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(5, 5, 10, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-blue);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    color: var(--accent-blue);
    font-weight: bold;
}

/* SMART HIGHLIGHT MENU */
#highlight-menu {
    position: absolute;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(5, 5, 10, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--accent-blue-glow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 10px) scale(0.9);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#highlight-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -10px) scale(1);
}

#highlight-menu::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--accent-blue);
}

#highlight-menu button {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

#highlight-menu .divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 5px;
}

/* HOVER EFFECTS */
@media (hover: hover) {
    .action-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-main);
        transform: scale(1.1);
    }

    .btn-audio:hover {
        background: var(--accent-blue);
        color: #000;
        box-shadow: 0 0 15px var(--accent-blue-glow);
    }

    .toc-nav a:hover {
        color: var(--text-main);
    }

    #highlight-menu button:hover {
        color: var(--accent-blue);
        background: rgba(0, 229, 255, 0.1);
        transform: translateY(-2px);
    }
}
