/* ==========================================================================
   Project Glossary tab (public project page)
   Used by: application/views/project-tailwind/project_details_glossary_tab.php
   ========================================================================== */

.glossary-wrap {
    width: 100%;
}

/* Toolbar: Regenerate button + search box ---------------------------------- */
.gl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Buttons ---------------------------------------------------------------- */
.gl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 0.7rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    transition: opacity 0.15s;
}

.gl-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Search --------------------------------------------------------------- */
.gl-search {
    position: relative;
    flex: 0 0 auto;
}

.gl-search input {
    width: 16rem;
    max-width: 60vw;
    padding: 0.55rem 0.75rem 0.55rem 2.1rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.7rem;
    font-size: 0.8125rem;
    color: #374151;
    background: #fff;
    outline: none;
}

.gl-search input:focus {
    border-color: #93C5FD;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.gl-search svg {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

/* Accordion list ----------------------------------------------------------- */
.gl-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.gl-item {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.gl-head {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.15rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.gl-head-text {
    min-width: 0;
}

.gl-term {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.2rem;
}

.gl-summary {
    font-size: 0.8125rem;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.gl-item.is-open .gl-summary {
    display: none;
}

.gl-chevron {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    color: #9CA3AF;
    transition: transform 0.18s;
}

.gl-item.is-open .gl-chevron {
    transform: rotate(180deg);
}

/* Expanded body ------------------------------------------------------------ */
.gl-body {
    padding: 0 1.15rem 1.15rem;
}

.gl-body-inner {
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    border-radius: 0.6rem;
    padding: 0.9rem 1rem;
}

.gl-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.3rem;
}

.gl-text {
    font-size: 0.8125rem;
    color: #374151;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.gl-divider {
    border: none;
    border-top: 1px solid #E5E7EB;
    margin: 0.85rem 0;
}

/* Empty state ------------------------------------------------------------ */
.gl-empty {
    max-width: 28rem;
    margin: 2.5rem auto;
    text-align: center;
    padding: 2.5rem 2rem;
    background: #fff;
    border: 1.5px dashed #BFDBFE;
    border-radius: 1.25rem;
}

.gl-empty-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 0 8px #EFF6FF;
}

.gl-empty p {
    margin: 0 0 0.5rem;
}

.gl-empty-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
}

.gl-empty-desc {
    font-size: 0.8125rem;
    color: #6B7280;
    line-height: 1.6;
    max-width: 22rem;
    display: inline-block;
}

.gl-empty-actions {
    margin-top: 1.5rem;
}

/* No search results ---------------------------------------------------- */
.gl-noresult {
    text-align: center;
    color: #6B7280;
    font-size: 0.8125rem;
    padding: 1.5rem 0;
    display: none;
}
