/* HERO GLOSSARY */
.glossary-hero {
    padding: 100px 15% 80px;
    background-color: var(--bg-primary);
    transition: background-color 0.5s ease;
}

.glossary-hero .hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 20px;
}

/* SEARCH SECTION */
.search-section {
    padding: 0 15% 80px;
    background-color: var(--bg-primary);
    transition: background-color 0.5s ease;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.5s ease;
}

.search-wrapper:focus-within {
    border-color: var(--electric-indigo);
}

.search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 24px;
    pointer-events: none;
    transition: color 0.5s ease;
}

.search-wrapper:focus-within .search-icon {
    color: var(--electric-indigo);
}

#glossary-search {
    width: 100%;
    background: transparent;
    border: none;
    padding: 15px 40px 15px 40px;
    font-size: 1rem;
    color: var(--stellar-white);
    outline: none;
    transition: color 0.5s ease;
}

.clear-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease;
}

.clear-icon:hover {
    color: var(--electric-indigo);
    transform: translateY(-50%) scale(1.1);
}

.clear-icon.visible {
    opacity: 1;
    pointer-events: all;
}

#glossary-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    transition: color 0.5s ease, opacity 0.5s ease;
}

/* GRID SECTION */
.glossary-section {
    padding: 0 15% 150px;
    background-color: var(--bg-primary);
    min-height: 50vh;
    transition: background-color 0.5s ease;
}

.glossary-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 30px;
}

.term-card {
    position: relative;
    padding: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    transition: var(--transition-smooth);
    overflow: hidden;
    z-index: 1;
}

.term-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(46, 49, 146, 0.08);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.term-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--noise);
    background-size: 100px 100px;
    background-repeat: repeat;
    opacity: 0.04;
    mix-blend-mode: overlay;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    pointer-events: none;
    z-index: -1;
}

.term-card:hover {
    border-color: var(--indigo-deep);
    transform: translateY(-5px);
}

.term-card:hover::after {
    opacity: 1;
}

.term-title {
    font-size: 1.9rem;
    margin-bottom: 15px;
    font-weight: 800;
    position: relative;
    z-index: 2;
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.term-card:hover .term-title {
    color: var(--stellar-white);
    text-shadow: 0 0 20px rgba(102, 45, 145, 0.4);
}

.term-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.5;
    position: relative;
    z-index: 2;
    transition: color 0.5s ease;
}

.no-results-msg {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.no-results-msg span {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    opacity: 0.3;
    transition: color 0.5s ease;
}

.no-results-msg p {
    color: var(--text-secondary);
    font-size: 1rem;
    opacity: 0.5;
    transition: color 0.5s ease;
}

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

/* PAGINAÇÃO (Estilo idêntico ao Portfólio) */
.glossary-pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 60px;
}

.page-dot {
    width: 45px;
    height: 45px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.5s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.page-dot:hover {
    color: var(--stellar-white);
    background: rgba(255, 255, 255, 0.062);
}

body.light-theme .page-dot:hover {
    background: rgba(0, 0, 0, 0.05);
}

.page-dot.active {
    color: var(--electric-indigo);
}

.page-dot:active {
    transform: scale(0.9);
}

.page-dot.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 20%;
    width: 60%;
    height: 2px;
    background: var(--electric-indigo);
    box-shadow: 0 0 15px var(--electric-indigo);
    animation: fadeInTab 0.4s ease forwards;
}

.page-dot:active {
    transform: scale(0.9);
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .glossary-hero .hero-title { 
        font-size: clamp(3rem, 12vw, 5rem);
        line-height: 1;
    }

    .glossary-hero,
    .search-section,
    .glossary-section {
        padding-left: 10%;
        padding-right: 10%;
    }

    .glossary-hero {
        padding-top: 150px;
    }
    
    .glossary-grid {
        grid-template-columns: 1fr;
    }
}