/* =========================================
   Glossary System (Wiki Style)
   ========================================= */

/* --- Archive Page --- */
.dpfp-glossary-archive {
    background: #f9f9f9;
    min-height: 100vh;
}

.glossary-hero {
    background: linear-gradient(135deg, var(--dpfp-blue) 0%, var(--dpfp-dark-blue) 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.glossary-hero .icon-wrapper {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.glossary-hero .hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.glossary-hero .hero-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

.glossary-search-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.glossary-submission-cta {
    margin-top: 25px;
}

.submit-term-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--dpfp-blue);
    padding: 14px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    border: 2px solid #fff;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
}

.submit-term-btn:hover {
    background: transparent;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.glossary-search-form {
    position: relative;
    display: flex;
}

.glossary-search-form i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.glossary-search-form .search-field {
    width: 100%;
    padding: 15px 100px 15px 50px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.glossary-search-form .search-submit {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    background: var(--dpfp-yellow);
    color: #333;
    border: none;
    border-radius: 40px;
    padding: 0 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.glossary-search-form .search-submit:hover {
    background: #ffc107;
}

/* Index Filter */
.glossary-index-filter {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-label {
    font-weight: 700;
    color: var(--dpfp-text);
    margin-right: 10px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.index-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f0f2f5;
    color: var(--dpfp-text);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
}

.index-btn:hover,
.index-btn.active {
    background: var(--dpfp-blue);
    color: #fff;
    transform: translateY(-2px);
}

/* Grid */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.glossary-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.glossary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--dpfp-blue);
}

.term-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dpfp-blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.term-title i {
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s;
}

.glossary-card:hover .term-title i {
    opacity: 1;
    transform: translateX(0);
}

.term-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.term-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.term-tag {
    font-size: 0.75rem;
    background: #eef4fa;
    color: var(--dpfp-blue);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* --- Single Page --- */
.dpfp-glossary-single {
    background: #f9f9f9;
    padding: 40px 0 80px;
}

.glossary-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.glossary-main-col {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.glossary-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.breadcrumb-simple {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-simple a {
    color: var(--dpfp-blue);
    text-decoration: none;
}

.entry-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.3;
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    /* Allow wrapping */
}

.term-cat-badge {
    background: var(--dpfp-yellow);
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.term-cat-badge:hover {
    background: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(238, 185, 2, 0.3);
}

.entry-date {
    font-size: 0.85rem;
    color: #888;
}

.glossary-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.glossary-content h2 {
    font-size: 1.6rem;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--dpfp-blue);
    color: var(--dpfp-blue);
}

.glossary-content h3 {
    font-size: 1.3rem;
    margin: 30px 0 15px;
    border-left: 5px solid var(--dpfp-yellow);
    padding-left: 15px;
}

.glossary-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.share-label {
    font-weight: 700;
    font-size: 0.9rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.share-btn:hover {
    transform: translateY(-3px);
}

.share-btn.twitter {
    background: #000;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.line {
    background: #06c755;
}

/* Sidebar */
.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

.sidebar-search-form {
    display: flex;
}

.sidebar-search-field {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    padding: 10px;
    font-size: 0.9rem;
}

.sidebar-search-submit {
    background: var(--dpfp-blue);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 15px;
    cursor: pointer;
}

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

.related-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #eee;
}

.related-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.related-list a {
    color: var(--dpfp-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
}

.related-list a:hover {
    color: var(--dpfp-blue);
}

.simulator-banner {
    display: block;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    padding: 25px;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: transform 0.3s;
}

.simulator-banner:hover {
    transform: scale(1.03);
}

.banner-sub {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #555;
}

.banner-main {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 15px;
    color: #d63384;
}

.banner-btn {
    display: inline-block;
    background: #fff;
    color: #d63384;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .glossary-layout {
        grid-template-columns: 1fr;
    }

    .glossary-main-col {
        padding: 25px;
    }

    .entry-title {
        font-size: 1.8rem;
    }
}

/* --- Submission Page --- */
.dpfp-glossary-submit {
    background: #f9f9f9;
    padding: 60px 0;
    min-height: 80vh;
}

.submit-form-wrapper {
    background: #fff;
    max-width: 800px;
    margin: 0 auto;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 15px;
    color: var(--dpfp-blue);
}

.page-desc {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.6;
}

.submit-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-weight: 700;
}

.submit-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.submit-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.required {
    color: #dc3545;
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--dpfp-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(4, 62, 128, 0.1);
}

.form-help {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

.category-checkboxes {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cat-group {
    margin-bottom: 20px;
}

.cat-group:last-child {
    margin-bottom: 0;
}

.cat-group-title {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--dpfp-blue);
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input {
    margin-right: 6px;
    accent-color: var(--dpfp-blue);
}

.form-actions {
    text-align: center;
    margin-top: 40px;
}

.submit-btn {
    background: var(--dpfp-yellow);
    color: #333;
    border: none;
    padding: 15px 50px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.submit-btn:hover {
    background: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
}

@media (max-width: 768px) {
    .submit-form-wrapper {
        padding: 30px 20px;
    }
}

/* --- Smart Source Display --- */
.glossary-source-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed #eee;
}

.source-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

.source-embed-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Responsive iframe for YouTube etc */
.source-embed-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}

/* Link Card Fallback */
.source-link-card {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.source-link-card:hover {
    background: #fff;
    border-color: var(--dpfp-blue);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.source-icon {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--dpfp-blue);
    margin-right: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.source-info {
    flex-grow: 1;
}

.source-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    font-weight: 700;
}

.source-url {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dpfp-blue);
    word-break: break-all;
}

/* Glossary Sort Controls */
.glossary-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.glossary-sort {
    display: flex;
    gap: 10px;
}

.sort-btn {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.sort-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.sort-btn.active {
    background: var(--dpfp-blue);
    color: #fff;
    border-color: var(--dpfp-blue);
}

/* Glossary Card Wrapper for Like Button */
.glossary-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.glossary-card {
    height: 100%;
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
    padding-bottom: 40px;
    /* Space for like button */
}

.glossary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Like Button */
.glossary-like-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.glossary-like-btn:hover {
    background: #fff0f5;
    color: #e0245e;
    border-color: #ffcdd2;
}

.glossary-like-btn.liked {
    color: #e0245e;
    background: #fff0f5;
    border-color: #ffcdd2;
}

.glossary-like-btn i {
    font-size: 1rem;
    transition: transform 0.2s;
}

.glossary-like-btn:active i {
    transform: scale(1.2);
}

.glossary-like-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Load More Button */
.load-more-wrapper {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    background: linear-gradient(135deg, #043e80 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(4, 62, 128, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(4, 62, 128, 0.4);
}

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

.load-more-btn:disabled,
.load-more-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.load-more-btn i {
    transition: transform 0.3s ease;
}

.load-more-btn:hover i {
    transform: translateY(2px);
}

.loading-indicator {
    color: #043e80;
    font-size: 1.1rem;
    margin-top: 20px;
}

.loading-indicator i {
    margin-right: 8px;
}