/* =====================================================
   SISTEMA DE NOTÍCIAS - ESTILOS
   ===================================================== */

/* Hero Section */
.news-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.news-hero h1 {
    color: white;
    font-size: 42px;
    margin: 0 0 15px 0;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.news-hero p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    margin: 0;
}

/* Container Principal */
.news-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

@media (max-width: 968px) {
    .news-page-container {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.news-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.filter-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botões de Filtro */
.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    width: 100%;
    text-align: left;
}

.filter-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-icon {
    font-size: 18px;
}

/* Busca */
.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* =====================================================
   CONTEÚDO PRINCIPAL
   ===================================================== */
.news-main {
    min-height: 500px;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.news-count {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
}

/* =====================================================
   GRID DE NOTÍCIAS
   ===================================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

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

/* Card de Notícia */
.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Badge de Destaque */
.news-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Imagem da Notícia */
.news-card-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #e2e8f0;
}

.news-category {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-transform: capitalize;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Conteúdo do Card */
.news-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: auto;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.news-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* =====================================================
   PAGINAÇÃO
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

/* =====================================================
   ESTADOS
   ===================================================== */
.loading-state,
.empty-state,
.error-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p,
.empty-state p,
.error-state p {
    margin-top: 16px;
    color: #64748b;
    font-size: 16px;
}

.empty-icon,
.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3,
.error-state h3 {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 24px;
}

/* =====================================================
   PÁGINA DE NOTÍCIA ÚNICA
   ===================================================== */
.news-detail-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.news-article {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.news-article .news-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 30px;
}

.news-article h1 {
    font-size: 36px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.news-meta {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    color: #64748b;
    font-size: 14px;
}

.news-content {
    font-size: 16px;
    line-height: 1.8;
    color: #475569;
}

.news-content p {
    margin: 0 0 16px 0;
}

.news-content strong {
    color: #1e293b;
    font-weight: 700;
}

/* Formatação tipo Discord/Markdown */
.news-content .news-h1 {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    margin: 24px 0 16px 0;
    line-height: 1.2;
    border-bottom: 3px solid #667eea;
    padding-bottom: 8px;
}

.news-content .news-h2 {
    font-size: 24px;
    font-weight: 700;
    color: #334155;
    margin: 20px 0 12px 0;
    line-height: 1.3;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 6px;
}

.news-content .news-h3 {
    font-size: 20px;
    font-weight: 600;
    color: #475569;
    margin: 16px 0 10px 0;
    line-height: 1.4;
}

.news-content em {
    font-style: italic;
    color: #64748b;
}

.news-content u {
    text-decoration: underline;
    text-decoration-color: #667eea;
    text-decoration-thickness: 2px;
}

.news-content del {
    text-decoration: line-through;
    opacity: 0.7;
    color: #94a3b8;
}

/* Espaçamento e quebras de linha */
.news-content br {
    display: block;
    content: "";
    margin: 4px 0;
}

/* Parágrafos com mais espaço */
.news-content {
    word-wrap: break-word;
}

.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Seção de Itens Relacionados */
.related-items-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e2e8f0;
}

.related-items-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
}

.related-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.related-item-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-item-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-item-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px auto;
}

.related-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.related-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.related-item-level {
    font-size: 12px;
    color: #64748b;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Responsividade */
@media (max-width: 768px) {
    .news-hero h1 {
        font-size: 32px;
    }

    .news-hero p {
        font-size: 16px;
    }

    .news-article {
        padding: 24px;
    }

    .news-article h1 {
        font-size: 28px;
    }

    .news-article .news-image {
        height: 250px;
    }

    .news-sidebar {
        position: static;
    }

    .related-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================================================
   ITENS INLINE NO CONTEÚDO
   ===================================================== */
.news-inline-item {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-family: inherit;
    font-size: 14px;
    vertical-align: middle;
    margin: 0 2px;
}

.news-inline-item:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
    z-index: 100;
}

/* Ícone do Item */
.news-item-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    padding: 0;
    display: block;
}

.news-item-icon-placeholder {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: transparent;
    border-radius: 0;
}

/* Nome do Item - Escondido */
.news-item-name {
    display: none;
}

/* Nível do Item - Escondido */
.news-item-level {
    display: none;
}

/* Cores por Qualidade - Removidas (ícone puro) */

/* =====================================================
   TOOLTIP DE ITEM
   ===================================================== */
.item-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: 280px;
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.item-tooltip.visible {
    opacity: 1;
}

/* Loading do Tooltip */
.item-tooltip-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.item-tooltip-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
}

/* Header do Tooltip */
.item-tooltip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-tooltip-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
}

.item-tooltip-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-tooltip-info {
    flex: 1;
}

.item-tooltip-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.item-tooltip-quality {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
}

.item-tooltip-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Stats do Item */
.item-tooltip-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
}

.item-stat-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
}

.item-stat-value {
    font-weight: 700;
    color: #22c55e;
}

/* Descrição */
.item-tooltip-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Cores de qualidade no tooltip */
.item-tooltip-quality.quality-1 { background: #9ca3af; }
.item-tooltip-quality.quality-2 { background: #22c55e; }
.item-tooltip-quality.quality-3 { background: #3b82f6; }
.item-tooltip-quality.quality-4 { background: #a855f7; }
.item-tooltip-quality.quality-5 { background: #f59e0b; }
.item-tooltip-quality.quality-6 { background: #ef4444; }

/* =====================================================
   SEÇÃO DE COMENTÁRIOS
   ===================================================== */
.comments-section {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.comments-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

/* Formulário de Comentário */
.comment-form-container {
    margin-bottom: 40px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.comment-form .form-group {
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    font-size: 14px;
}

.character-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.character-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.comment-login-prompt {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 30px;
}

.comment-login-prompt p {
    color: #64748b;
    margin-bottom: 16px;
}

/* Lista de Comentários */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.loading-comments {
    text-align: center;
    padding: 40px;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 16px;
}

.comment-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.2s ease;
}

.comment-item:hover {
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-icon {
    font-size: 20px;
}

.author-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

.comment-time {
    font-size: 12px;
    color: #94a3b8;
}

.comment-body {
    color: #475569;
    line-height: 1.6;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Modal base (estilo alquimia) */
.alq-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.2s;
}

.alq-modal.active {
    display: block;
}

.alq-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.alq-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.alq-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 2px solid #e2e8f0;
}

.alq-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
}

.alq-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

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

/* Lista de personagens no modal */
.character-select-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.saved-loading {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 14px;
}

.suggest-char-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
}

.suggest-char-btn:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.suggest-char-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.char-btn-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

.char-btn-level {
    font-size: 13px;
    color: #64748b;
    padding: 4px 12px;
    background: #e2e8f0;
    border-radius: 6px;
}

.char-btn-sending {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
}

/* Responsividade */
@media (max-width: 768px) {
    .comments-section {
        padding: 24px;
        margin: 40px 20px 0;
    }

    .comments-title {
        font-size: 24px;
    }

    .comment-form-container {
        padding: 16px;
    }

    .character-select-list {
        max-height: 300px;
    }
}
