/* ========================================
   WWM Brasileiro - Glossary Page Styles
   ======================================== */

/* ========== PAGE HEADER ========== */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.page-header h1 i {
    margin-right: 0.5rem;
}

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

/* ========== STATS CARDS ========== */
.glossary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(139, 90, 43, 0.1));
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.2);
}

.stat-card > i {
    font-size: 2rem;
    color: var(--gold);
    width: 50px;
    text-align: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ========== CONTROLS ========== */
.glossary-controls {
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box > i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.clear-search:hover {
    color: var(--gold);
}

/* ========== CATEGORY FILTERS ========== */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    border-color: rgba(201, 162, 39, 0.5);
    color: var(--text-primary);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-color: var(--gold);
    color: var(--bg-dark);
    font-weight: 600;
}

.category-btn i {
    font-size: 0.85rem;
}

/* ========== FILTER TAGS ========== */
.filter-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.filter-tag.active {
    background: rgba(201, 162, 39, 0.2);
    border-color: var(--gold);
    color: var(--gold);
}

/* ========== GLOSSARY GRID ========== */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.term-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(20, 20, 20, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.term-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--category-color, var(--gold));
    transition: width 0.3s ease;
}

.term-card:hover {
    transform: translateY(-3px);
    border-color: rgba(201, 162, 39, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.term-card:hover::before {
    width: 6px;
}

.term-card.no-translate {
    border-color: rgba(231, 76, 60, 0.3);
}

.term-card.no-translate::before {
    background: #e74c3c;
}

.term-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.term-original {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.term-chinese {
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 500;
}

.term-translation {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.term-context {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.term-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.term-category {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-secondary);
}

.term-category i {
    color: var(--category-color, var(--gold));
}

.term-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.term-badge.no-translate {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.term-badge.translate {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

/* ========== LOADING ========== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(201, 162, 39, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state.hidden {
    display: none;
}

.empty-state i {
    font-size: 4rem;
    color: rgba(201, 162, 39, 0.3);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
}

.pagination button.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg-dark);
    font-weight: 600;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== TERM MODAL - NOTION STYLE REDESIGN ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.term-modal-content {
    background: linear-gradient(180deg, #1a1a22 0%, #12121a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: notionModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notionModalIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.term-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.term-modal-content .modal-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold);
    margin: 0;
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gold);
}

/* Modal Body */
.term-modal-content .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 160px);
}

/* Detail Grid - Notion Property Layout */
.term-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

.detail-section:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.6rem;
}

.detail-section label i {
    font-size: 0.8rem;
    color: var(--gold);
    opacity: 0.8;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.5;
}

.detail-value.translation {
    color: var(--gold);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(201, 162, 39, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--gold);
}

.detail-value.chinese {
    font-size: 1.75rem;
    letter-spacing: 2px;
    padding: 0.5rem 0;
}

.detail-value.context {
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.detail-value.aliases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-value.aliases span {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    background: rgba(201, 162, 39, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gold);
    transition: all 0.15s ease;
}

.detail-value.aliases span:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: var(--gold);
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-badge:hover {
    transform: scale(1.02);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-badge.translate {
    background: rgba(39, 174, 96, 0.15);
    color: #4ade80;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.status-badge.no-translate {
    background: rgba(231, 76, 60, 0.15);
    color: #f87171;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Modal Footer */
.term-modal-content .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: 8px;
    color: var(--bg-dark);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-close {
    padding: 0.65rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .glossary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card > i {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .glossary-grid {
        grid-template-columns: 1fr;
    }
    
    .term-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .category-btn {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .glossary-stats {
        grid-template-columns: 1fr;
    }
    
    .filter-tags {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .filter-tag {
        white-space: nowrap;
    }
}
