/* RedAI-Web – Changelog / Anuncios (páginas públicas) */

.public-changelog-page {
    padding: 1rem 0;
    min-height: 60vh;
    background: var(--neo-bg-primary);
}

.public-changelog-page .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========== FULLVIEW: changelog/anuncios a pantalla completa ========== */
.public-changelog-fullview {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 64px);
    padding: 0;
    margin: 0;
}

.public-changelog-fullview .changelog-fullview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.public-changelog-fullview .changelog-fullview-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neo-text);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.public-changelog-fullview .changelog-fullview-label i {
    color: var(--neo-primary);
    font-size: 0.8rem;
}

.public-changelog-fullview .changelog-fullview-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.public-changelog-fullview .changelog-fullview-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.public-changelog-fullview .changelog-fullview-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.5rem;
}

.public-changelog-fullview .changelog-list {
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .public-changelog-fullview .changelog-fullview-toolbar {
        flex-wrap: wrap;
        padding: 0.5rem 0.75rem;
    }
    .public-changelog-fullview .changelog-fullview-controls {
        width: 100%;
    }
    .public-changelog-fullview .changelog-fullview-controls .search-input {
        flex: 1;
        min-width: 0;
    }
}

/* Título y controles como barra única integrada (forzado para que no lo tape nada) - legacy */
.public-changelog-page:not(.public-changelog-fullview) .changelog-doc-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    margin-bottom: 0.5rem !important;
    padding: 0.4rem 0 !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.public-changelog-page .changelog-doc-title {
    flex: 1 !important;
    min-width: 0 !important;
}

.public-changelog-page .changelog-doc-title h1 {
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
}

.public-changelog-page .changelog-doc-title h1 i {
    -webkit-text-fill-color: initial !important;
    color: var(--neo-primary) !important;
    font-size: 0.875rem !important;
}

.public-changelog-page .changelog-doc-subtitle {
    font-size: 0.75rem !important;
    color: var(--neo-muted) !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 500 !important;
}

.public-changelog-page .changelog-doc-header .changelog-controls {
    display: flex !important;
    gap: 0.4rem !important;
    margin: 0 !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.search-container { position: relative; }

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 0.5rem;
    color: var(--neo-muted);
    z-index: 2;
    font-size: 0.75rem;
}

.search-input {
    padding: 0.4rem 0.6rem 0.4rem 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--neo-surface);
    color: var(--neo-text);
    font-size: 0.8125rem;
    width: 180px;
    min-width: 140px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--neo-primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.search-focus-border {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.search-input:focus + .search-focus-border {
    opacity: 0.2;
}

.version-filter {
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--neo-surface);
    color: var(--neo-text);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-width: 0;
}

.version-filter:focus {
    outline: none;
    border-color: var(--neo-primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.changelog-card {
    background: var(--neo-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.6s ease forwards;
}

.changelog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--neo-primary), var(--neo-accent));
}

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

.changelog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--neo-primary);
}

.changelog-card.hidden {
    display: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(124, 58, 237, 0.02) 100%);
    position: relative;
    flex-shrink: 0;
    gap: 0.5rem;
}

.entry-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.version-badge { position: relative; flex-shrink: 0; }

.version-number {
    background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
    display: block;
}

.version-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.3) 0%, transparent 70%);
    border-radius: 2rem;
    animation: versionGlow 2s ease-in-out infinite;
}

@keyframes versionGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.entry-details {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.entry-title {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 1;
}

.entry-subtitle {
    font-size: 0.75rem;
    color: var(--neo-muted);
    margin: 0;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 1;
}

.entry-meta {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--neo-muted);
    font-weight: 500;
}

.meta-item i {
    color: var(--neo-primary);
    font-size: 0.75rem;
}

.card-body { padding: 1rem 1.25rem; }

.entry-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--neo-text);
    margin-bottom: 2rem;
}

.entry-description p { margin-bottom: 1rem; }

.entry-description h1, .entry-description h2, .entry-description h3 {
    margin: 1.5rem 0 0.75rem 0;
    color: var(--neo-text);
    font-weight: 600;
}

.entry-description ul, .entry-description ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.entry-description li { margin-bottom: 0.5rem; }

.entry-description code {
    background: rgba(124, 58, 237, 0.1);
    color: var(--neo-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: Monaco, Menlo, 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.entry-description pre {
    background: var(--neo-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.entry-description pre code {
    background: none;
    color: var(--neo-text);
    padding: 0;
}

.entry-media {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.media-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--neo-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.media-header h3 i { color: var(--neo-primary); }

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.media-item {
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: var(--neo-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.media-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--neo-primary);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-overlay i { color: white; font-size: 1.5rem; }

.media-item:hover .media-overlay { opacity: 1; }

.media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--neo-muted);
    font-size: 0.75rem;
}

.media-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Modal de media público */
.public-media-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.public-media-modal.show {
    display: flex;
}

.public-media-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.public-media-container {
    position: relative;
    background: var(--neo-surface);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    height: 600px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

@keyframes modalSlideIn {
    from { transform: scale(0.9) translateY(-30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.public-media-header {
    background: linear-gradient(135deg, var(--neo-primary) 0%, var(--neo-accent) 100%);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.public-media-modal .media-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 600;
}

.public-media-modal .media-title i { font-size: 1.25rem; }

.public-media-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.public-media-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.close-inner {
    color: white;
    font-size: 1rem;
    z-index: 2;
    position: relative;
}

.close-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.public-media-close:hover .close-ripple {
    width: 100%;
    height: 100%;
}

.public-media-body {
    padding: 2rem;
    height: calc(100% - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-media-modal .media-content {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-media-modal .media-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    object-fit: contain;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-icon {
    position: relative;
    font-size: 4rem;
    color: var(--neo-muted);
    margin-bottom: 1rem;
}

.empty-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: emptyGlow 2s ease-in-out infinite;
}

@keyframes emptyGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.6; }
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--neo-text);
}

.empty-state p {
    color: var(--neo-muted);
    max-width: 400px;
    margin: 0 auto 2rem auto;
}

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

.results-counter {
    text-align: center;
    padding: 1rem;
    color: var(--neo-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.results-counter span {
    color: var(--neo-primary);
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

@media (max-width: 768px) {
    .changelog-doc-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .changelog-doc-title h1 { font-size: 1rem; }
    .changelog-doc-subtitle { font-size: 0.75rem; }
    .changelog-doc-header .changelog-controls { flex-direction: row; justify-content: flex-start; }
    .search-input { width: 100%; min-width: 0; }
    .entry-info { flex-direction: row; gap: 0.5rem; }
    .entry-meta { align-items: center; }
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    .card-header { padding: 0.5rem 1rem; }
    .card-body { padding: 1rem; }
    .public-media-container {
        width: 95vw;
        height: 80vh;
        border-radius: 16px;
    }
    .public-media-header { padding: 1rem 1.5rem; }
    .public-media-body { padding: 1rem; }
}
