/* Base Glossary Styles */

/* =========================================
   Glossary Index (Shortcode)
   ========================================= */
.elkz-glossary-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Category Filter */
.elkz-glossary-filter {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.elkz-filter-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 6px 15px;
    margin: 0 5px 5px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    transition: all 0.2s;
}

.elkz-filter-btn:hover,
.elkz-filter-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* --- Glossary Index --- */
.elkz-glossary-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Open Sans', sans-serif;
}

.elkz-glossary-controls {
    position: sticky;
    top: 50px;
    /* Adjust based on admin bar/theme header */
    z-index: 99;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Dropdown Filter */
.elkz-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    background-color: #fff;
}

/* Nav */
.elkz-glossary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.elkz-glossary-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.elkz-glossary-nav a:hover,
.elkz-glossary-nav a.active {
    background-color: #2c3e50;
    color: #fff;
}

.elkz-glossary-nav a.disabled {
    color: #ccc;
    pointer-events: none;
}

/* Letters Grid */
.elkz-glossary-index {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.elkz-glossary-letter-group {
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
}

.elkz-letter-heading {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 28px;
    color: #2c3e50;
    font-weight: 800;
    position: relative;
    padding-left: 15px;
    display: flex;
    align-items: center;
}

.elkz-letter-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #3498db, #8e44ad);
    border-radius: 4px;
}

.elkz-term-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.elkz-term-item {
    margin: 0;
}

.elkz-term-link {
    text-decoration: none;
    color: #444;
    font-weight: 600;
    font-size: 15px;
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.elkz-term-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #8e44ad);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.elkz-term-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: transparent;
    color: #2c3e50;
}

.elkz-term-link:hover::after {
    opacity: 1;
}

/* --- Single Glossary Page --- */
.elkz-glossary-single-page {
    padding-top: 50px;
    padding-bottom: 60px;
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.elkz-glossary-card {
    background: #fff;
    border: none;
    border-radius: 16px;
    padding: 50px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.elkz-glossary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #3498db, #8e44ad, #f1c40f);
}

.elkz-glossary-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 30px;
    margin-bottom: 40px;
    text-align: center;
    /* Modern centering */
}

.entry-title {
    margin: 0 0 15px 0;
    font-size: 42px;
    color: #2c3e50;
    font-weight: 800;
    letter-spacing: -1px;
    background: -webkit-linear-gradient(45deg, #2c3e50, #34495e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.elkz-meta-line {
    font-size: 0.95em;
    color: #7f8c8d;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-style: italic;
}

.elkz-synonyms {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 15px;
    background: #f8f9fa;
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid #eee;
}

/* Layout: Body + Cartouche */
.elkz-glossary-body {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    align-items: flex-start;
}

.elkz-content-main {
    flex: 2;
    min-width: 300px;
    font-size: 1.1em;
    /* Slightly larger reading text */
    line-height: 1.8;
}

.elkz-content-main p {
    margin-bottom: 1.5em;
    color: #4a5568;
}

/* Variations Style */
.elkz-variations {
    margin-top: 30px;
    padding: 15px 20px;
    background: #fff8e1;
    border-left: 4px solid #f1c40f;
    color: #7f6000;
    border-radius: 4px;
    font-style: italic;
}

/* Cartouche Sidebar */
.elkz-cartouche {
    flex: 1;
    width: auto;
    min-width: 280px;
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    position: relative;
    border-top: 4px solid #3498db;
    /* Accent top */
}

.elkz-cartouche-title {
    margin-top: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #95a5a6;
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-weight: 700;
}

.elkz-cartouche-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.elkz-cartouche-list li {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e1e8ed;
}

.elkz-cartouche-list li:last-child {
    border-bottom: none;
}

/* Badges */
.elkz-badges-row {
    margin-bottom: 20px;
}

.elkz-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e3f2fd;
    color: #1e88e5;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    margin-right: 5px;
    transition: background 0.2s;
}

.elkz-type-badge:hover {
    background-color: #bbdefb;
    color: #1565c0;
}

.elkz-cartouche-list .label {
    font-weight: 700;
    color: #555;
    margin-right: 10px;
}

.elkz-cartouche-list .value {
    text-align: right;
    color: #333;
}

.elkz-forum-ref {
    flex-direction: column;
    align-items: flex-start !important;
}

.elkz-forum-ref .value {
    text-align: left;
    margin-top: 4px;
    display: block;
}

/* Footer Buttons */
.elkz-glossary-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.elkz-btn-references {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent;
    color: #27ae60;
    border: 2px solid #27ae60;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.elkz-btn-references:hover {
    background-color: #27ae60;
    color: #fff;
    text-decoration: none;
}

.elkz-back-link {
    color: #999;
    text-decoration: none;
    font-size: 0.9em;
}

.elkz-back-link:hover {
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .elkz-glossary-body {
        flex-direction: column;
    }

    .elkz-cartouche {
        width: 100%;
    }

    .elkz-glossary-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Tooltip (Basic) */
.elkz-tooltip {
    border-bottom: 1px dotted #888;
    cursor: help;
}