/* =========================
   THEME VARIABLES (GLOBAL CONTROL)
========================= */

:root {

    /* =========================
       BRAND COLORS
    ========================= */

    --primary: #CDA861;          /* GOLD */
    --primary-hover: #b8934f;

    --secondary: #192636;        /* DEEP BLUE */
    --secondary-light: #2a3a4d;

    --gold-soft: #E6C98A;        /* subtle glow */

    /* =========================
       BACKGROUNDS
    ========================= */

    --bg-main: #F8F6F1;          /* warm premium bg */
    --bg-card: #ffffff;

    /* =========================
       TEXT
    ========================= */

    --text-main: #192636;        /* deep blue text */
    --text-muted: #6b7280;

    /* =========================
       BORDERS
    ========================= */

    --border: #e7e2d9;

    /* =========================
       UI
    ========================= */

    --radius: 14px;
}

/* =========================
   GLOBAL
========================= */

html, body {
    height: 100%;
    background:
    radial-gradient(1200px 400px at top center, rgba(205,168,97,0.12), transparent),
    linear-gradient(180deg, #F8F6F1 0%, #ffffff 100%);
}
/* ADMIN LAYOUT ONLY */
.admin-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* MAIN CONTENT (for sticky footer) */
.main-content {
    min-height: calc(100vh - 140px);
}

/* CONTAINER */
.container {
    max-width: 1100px;
}

/* =========================
   NAVBAR
========================= */

.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

/* =========================
   HEADINGS
========================= */

h1, h2, h3 {
    font-weight: 700;
}

/* =========================
   CARD SYSTEM
========================= */

.admin-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}
.admin-card h4 {
    font-size: 28px;
    font-weight: 700;
}

.admin-card h5 {
    font-weight: 600;
}
/* =========================
   BUTTONS
========================= */

.btn-dark {
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
}

.btn-dark:hover {
    background: var(--primary-hover);
}

/* =========================
   INPUTS
========================= */

.form-control {
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

/* =========================
   TABLE
========================= */

.table {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.table td {
    vertical-align: middle;
}

/* =========================
   FOOTER
========================= */

.admin-footer {
    font-size: 13px;
    color: var(--text-muted);
}

/* =========================
   LOADER
========================= */

#loader {
    position: fixed;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* spinner */
#loader::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* fade out */
body.loaded #loader {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
/* =========================
   DARK MODE FIXES
========================= */

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

/* Table Fix */
.table {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border);
}

.table th {
    background: var(--bg-card);
    color: var(--text-main);
}

.table td {
    background: var(--bg-card);
    color: var(--text-main);
}

/* Buttons Fix */
.btn-outline-dark {
    color: var(--text-main);
    border-color: var(--border);
}

.btn-outline-dark:hover {
    background: var(--primary);
    color: #fff;
}

/* Trash Button Fix */
.btn-danger {
    border-radius: var(--radius);
}

/* Navbar Text */
.navbar a {
    color: var(--text-main);
}

.navbar a:hover {
    color: var(--primary);
}
/* =========================
   WORD LAYOUT
========================= */

.word-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 30px;
}

.word-image {
    max-width: 250px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.word-content {
    flex: 1;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .word-layout {
        flex-direction: column;
    }

    .word-image {
        max-width: 100%;
    }
}
/* =========================
   NAVBAR SYSTEM
========================= */

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
}/* =========================
   WORD PAGE PRO UI
========================= */

/* Header */
.word-header h1 {
    font-size: 42px;
    margin-bottom: 5px;
}

.word-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Layout improvement */
.word-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 25px;
}

/* Image box (clean card look) */
.word-image-box {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Image */
.word-image {
    max-width: 220px;
    width: 100%;
    border-radius: 8px;
}

/* Content spacing */
.word-content {
    flex: 1;
}

/* Each info block */
.word-block {
    margin-bottom: 18px;
}

/* Label styling */
.word-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Value text */
.word-block p {
    font-size: 16px;
    margin: 0;
}

/* Narrative (make it premium) */
.word-narrative-block {
    margin-top: 40px;
    padding: 25px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    line-height: 1.7;
    font-size: 16px;
}

/* Slight elevation effect */
.word-narrative-block:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .word-layout {
        flex-direction: column;
    }

    .word-image-box {
        text-align: center;
    }

    .word-image {
        max-width: 100%;
    }
}
.user-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.user-modal-content {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    width: 450px;
}
/* HOME LAYOUT */
.home-container {
    text-align: center;
    padding-top: 60px;
}

/* LOGO */
.hero-logo {
    margin-bottom: 30px;
}

.main-logo {
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tagline{
    font-size:20px;
    color:#374151; /* darker */
    font-weight:500;
    margin-top:18px;
}

/* SEARCH */
.search-wrapper {
    max-width: 700px;
    margin: 20px auto;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.85);
    border-radius: 60px;
    padding: 18px 26px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    gap: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}
.search-box:focus-within{
    border-color: var(--primary);
    box-shadow: 0 25px 80px rgba(99,102,241,0.25);
}
.search-box:hover{
    transform: translateY(-2px);
    box-shadow: 0 25px 70px rgba(0,0,0,0.15);
}

.search-icon {
    font-size: 18px;
    color: #888;
}
.search-btn {
    background: var(--primary);
    color: #fff;
    border-radius: 30px;
    padding: 10px 20px;
    transition: 0.3s;
}

.search-btn:hover {
    background: var(--primary-hover);
}
.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 18px;
    color: #111;
    background: transparent;
}

.search-box input::placeholder {
    color: #374151; /* darker = better UX */
    font-weight: 500;
}

.search-box button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 12px 26px;
    border-radius: 40px;
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
}
.search-box button:hover{
    background: var(--primary-hover);
    transform: scale(1.05);
}
.word-card-day{
    margin:50px auto;
    max-width:460px;
    padding:32px 28px;
    border-radius:20px;
    border:1px solid rgba(0,0,0,0.04);

    background:
        linear-gradient(180deg, #ffffff, #fafafa);

    box-shadow:
        0 10px 30px rgba(0,0,0,0.05),
        0 30px 80px rgba(0,0,0,0.06);

    transition:0.35s ease;
}
.word-card-day:hover{
    transform:translateY(-6px);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.08),
        0 40px 100px rgba(0,0,0,0.08);
}

/* BADGE */
.word-card-day .badge {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #7c7c7c;
    display: block;
    margin-bottom: 12px;
}

/* WORD */
.word-card-day h2 {
    font-family: 'Playfair Display', serif; /* 🔥 IMPORTANT */
    letter-spacing:0.5px;
    font-size: 36px;
    margin: 10px 0;
    color: #1e293b;
    font-weight:700;
}

/* TEXT */
.word-card-day p {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: #555;
    margin-bottom: 15px;
}

/* LINK */
.word-day-link,
.view-btn{
    display:inline-block;
    margin-top:10px;
    padding:8px 16px;
    border-radius:999px;
    border:1px solid #ddd;
    transition:0.3s;
}

.view-btn:hover{
    background:#111;
    color:#fff;
    border-color:#111;
}
/* =========================
   WORD DAY HEADER (ICON STYLE)
========================= */

.word-day-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* ICON CIRCLE */
.word-day-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* TEXT */
.word-day-badge {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
}
/* DROPDOWN */
.search-dropdown {
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    margin-top: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    z-index: 9999;

    display: none; /* ✅ simpler + reliable */
}

/* visible state */
.search-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}
.search-item:first-child {
    font-weight: 600;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}
.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-item {
    padding: 14px 20px;
    cursor: pointer;
    font-size: 15px;
}

.search-item:hover {
    background: #f7f7f7;
}
.dropdown-section {
    padding: 12px 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    display: block;
    background: #fafafa;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.dropdown-section strong {
    color: #333;
}
.category-filter {
    margin-top: 10px;
}

.category-chip {
    display: inline-block;
    padding: 6px 12px;
    margin: 5px;
    background: #f1f5f9;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    color: #333;
}

.category-chip.active {
    background: #6366f1;
    color: #fff;
}

.sort-bar a {
    margin: 0 8px;
    font-size: 14px;
    text-decoration: none;
    color: #666;
    padding: 6px 10px;
    border-radius: 8px;
}

.sort-bar a.active {
    background: #6366f1;
    color: #fff;
}

/* =========================
   FEATURED BADGE (FIXED)
========================= */

.featured-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px; /* pill shape */
    margin-bottom: 8px;
    width: fit-content; /* VERY IMPORTANT */
}
.browse-link {
    float: right;
    color: #999;
    font-size: 13px;
    cursor: pointer;
}

.browse-link:hover {
    color: #333;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
}

/* WORD OF DAY */
.word-of-day {
    margin-top: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.word-of-day h4 {
    color: #888;
    margin-bottom: 10px;
}

.word-of-day h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.word-of-day p {
    color: #666;
    font-size: 15px;
}

.section-padding {
    padding: 60px 0;
}

.section-title {
    font-weight: 600;
    margin-bottom: 30px;
}

.word-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    transition: 0.3s;
    border: 1px solid #eee;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.word-card.small {
    text-align: center;
}
.section-padding {
    padding: 70px 0;
}

.section-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 35px;
}

/* PREMIUM CARD */
.word-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.word-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
}

/* IMAGE CARD */
.word-card.premium .word-image {
    height: 180px;
    background-size: contain;
    background-position: center;
    background-repeat:no-repeat;
}

.word-card.premium .word-content {
    padding: 18px;
}

.word-card.premium h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.word-card.premium p {
    font-size: 14px;
    color: #666;
}

/* MINIMAL CARD */
.word-card.minimal {
    padding: 20px;
    text-align: center;
    font-weight: 500;
}

.word-card.minimal:hover {
    background: #f9f9f9;
}
.category-chip {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
}

.category-chip:hover {
    background: #6366f1;
    color: #fff;
}
.row {
    row-gap: 20px;
}
/* =========================
   CATEGORY CARD IMAGE FIX
========================= */

.word-card img {
    height: 140px;
    width: 100%;
    object-fit: contain; /* important: no crop */
    background: #f8fafc;
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.word-card {
    overflow: hidden;
    border-radius: 12px;
}

.word-card .card-body {
    min-height: 150px;
}
/* =========================
   DROPDOWN PREMIUM UPGRADE
========================= */

.dropdown-title {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: #fafafa;
}

.dropdown-row {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}

.dropdown-row:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.dropdown-row.category {
    font-weight: 500;
}
.dropdown-row {
    position: relative;
}

.dropdown-row::after {
    content: "→";
    position: absolute;
    right: 16px;
    opacity: 0;
    transition: 0.2s;
}

.dropdown-row:hover::after {
    opacity: 1;
}

.dropdown-row.text-muted {
    text-align: center;
    padding: 16px;
    color: #94a3b8;
}
/* =========================
   CATEGORY GRID DROPDOWN
========================= */

/* =========================
   CATEGORY GRID PREMIUM
========================= */

.category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px 16px;
    justify-content: center;
    max-width: 520px;
    margin: 0 auto;
}

/* CHIP */
.category-chip-advanced {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4f46e5;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
}

/* HOVER EFFECT */
.category-chip-advanced:hover {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* CLICK FEEDBACK */
.category-chip-advanced:active {
    transform: scale(0.96);
}
.category-chip-advanced::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: 0.25s;
}

.category-chip-advanced:hover::after {
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
/* =========================
   TOP RESULT STYLE
========================= */

.top-result {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    background: #eef2ff;
    border-radius: 8px;
    margin: 6px 10px;
}

.top-result:hover {
    background: #6366f1;
    color: #fff;
}
/* =========================
   SEARCH CARD IMAGE
========================= */
.word-thumb {
    height: 120px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
}

.word-thumb img {
    max-height: 90px;
    max-width: 90%;
    object-fit: contain;
}

/* =========================
   CATEGORY TAGS
========================= */
.word-cats {
    margin: 6px 0 8px;
}

.word-cats span {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    margin-right: 5px;
    margin-bottom: 4px;
}

/* MATCH SOURCE */
.match-source {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    margin-top: 2px;
}
/* =========================
   SAAS QUICK ACTION UI
========================= */

.quick-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 60px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.quick-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 60px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: 0.2s;
}

.quick-row:hover {
    background: rgba(99,102,241,0.03);
}

/* WORD */
.quick-word {
    font-weight: 500;
}

/* =========================
   TOGGLE SWITCH (SAAS STYLE)
========================= */

.toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.toggle input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    border-radius: 999px;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

/* ACTIVE */
.toggle input:checked + .slider {
    background: #22c55e;
}

.toggle input:checked + .slider::before {
    transform: translateX(20px);
}

/* GOLD FEATURE TOGGLE */
.toggle.gold input:checked + .slider {
    background: #f59e0b;
}

/* =========================
   ICON BUTTON
========================= */

.icon-btn {
    border: none;
    background: #f1f5f9;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* DELETE STYLE */
.icon-btn.delete {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================
   TOOLTIP
========================= */

.icon-btn[data-tooltip] {
    position: relative;
}

.icon-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.icon-btn:hover::after {
    opacity: 1;
}
/* =========================
   TRASH BADGE (SaaS UI)
========================= */

.trash-btn {
    position: relative;
}

.trash-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 600;
}
/* =========================
   FULL WIDTH STATS FIX
========================= */

.stats-row {
    display: flex;
    gap: 20px;
}

.stat-col {
    flex: 1;
}

/* MOBILE */
@media (max-width: 768px) {
    .stats-row {
        flex-wrap: wrap;
    }

    .stat-col {
        flex: 0 0 48%;
    }
}
/* =========================
   EMPTY STATE (SAAS)
========================= */

.empty-state {
    padding: 25px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.empty-state small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}
/* =========================
   LOADING STATES
========================= */

.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* toggle loading animation */
.toggle.loading .slider {
    background: #cbd5f5;
}

.toggle.loading .slider::before {
    animation: spinToggle 0.6s linear infinite;
}

@keyframes spinToggle {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* TOAST */
.toast-msg {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #111827;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
    z-index: 9999;
}

.toast-msg.show {
    opacity: 1;
    transform: translateY(0);
}
.table-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 10px;
}

.table-pagination button {
    border: 1px solid var(--border);
    background: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.table-pagination button:hover {
    background: var(--primary);
    color: #fff;
}
/* =========================
   PAGINATION SMOOTH TRANSITION
========================= */

.fade-slide {
    animation: fadeSlide 0.25s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
#catNumbers button {
    min-width: 32px;
    border-radius: 6px;
}

#catNumbers .btn-dark {
    transform: scale(1.05);
}
/* =========================
   LAYOUT
========================= */
.word-page {
    display: flex;
    height:auto!important;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 20%;
    min-width: 240px;
    padding: 30px 20px;
    border-right: 1px solid #e5e5e5;
    background: #fafafa;
}

/* LOGO */
.sidebar-logo {
    margin-bottom: 30px;
}

.sidebar-logo img {
    max-width: 140px;
    display: block;
}

/* BACK BUTTON */
.sidebar-back {
    display: inline-block;
    margin-bottom: 30px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-back:hover {
    text-decoration: underline;
}

/* SECTION */
.sidebar-section {
    margin-top: 20px;
}

/* TITLE */
.sidebar-title {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
}

/* LINKS */
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    text-decoration: none;
    color: #111;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    transform: translateX(4px);
    color: #000;
}

/* =========================
   CONTENT
========================= */
.content {
    width: 80%;
    padding: 40px 60px;
}

/* TITLE */
.word-title {
    font-size: 52px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 30px;
}



.word-table .label {
    font-weight: 500;
    color: #444;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.word-table .value {
    color: #222;
    line-height: 1.8;
    font-size: 15px;
}

/* IMAGE */
.word-content-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 40px;
    align-items: start;
}

/* NARRATIVE */
.narrative .label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
}
/* =========================
   PREMIUM DIVIDERS
========================= */
.word-divider {
    border: none;
    border-top: 1px solid rgba(205,168,97,0.3);
    margin: 30px 0;
}

/* =========================
   WORD TABLE ROWS (RICH LOOK)
========================= */
.word-table .row {
    display: grid;
    grid-template-columns: 220px 1fr;
    padding: 18px 0;
    border-bottom: 1px solid #ececec;
    align-items: start;
    gap: 10px;
}

.word-table .label {
    width: 220px;
    font-weight: 500;
    color: #444;
    letter-spacing: 0.3px;
}

.word-table .value {
    flex: 1;
    color: #222;
    line-height: 1.7;
}

/* =========================
   IMAGE
========================= */
.word-image-float {
    width: 190px;
    border-radius: 12px;
    margin-left: 50px;
}

/* =========================
   NARRATIVE (🔥 HIGHLIGHTED BLOCK)
========================= */
.narrative {
    background: #fafafa;
    padding: 15px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
}

.narrative .label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
    display: block;
    margin-bottom: 12px;
}

.narrative p {
    line-height: 1.8;
    color: #333;
    margin: 0;
}

/* =========================
   RELATED WORDS (PREMIUM CHIP STYLE)
========================= */
.sidebar-title {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 15px;
}

.sidebar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 🔥 CHIP STYLE (NOT MUTED ANYMORE) */
.sidebar-link {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    color: #111;
    background: #fff;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}
/* =========================
   INLINE IMAGE + TABLE LAYOUT
========================= */
.word-content-layout {
    display: flex;
    align-items: flex-start;
    gap: 50px;
}

/* LEFT TABLE */
.word-table {
    flex: 1;
}

/* RIGHT IMAGE */
.word-image-wrap {
    width: 220px;
    flex-shrink: 0;
}

.word-image {
    width: 100%;
    border-radius: 10px;
}

/* =========================
   ROW FIX (IMPORTANT)
========================= */
.word-table .row {
    display: grid;
    grid-template-columns: 220px 1fr;
    border-bottom: 1px solid #ececec;
    align-items: start;
}

/* prevent weird stacking */
.word-table {
    width: 100%;
}

/* =========================
   RELATED WORDS BOTTOM
========================= */
.related-bottom {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #ddd;
}

.related-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.related-chip {
    display: block;
    text-align: center;
    padding: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    color: #111;
    background: #fff;
    transition: all 0.2s ease;
}

.related-chip:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}
.badge {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
}
.hero-logo{
    text-align:center;
    margin-bottom:50px;
}

.logo-img{
    height:70px;
    margin-bottom:18px;
}

.logo-title{
    font-size:44px;
    font-weight:700;
    letter-spacing:2px;
    margin-bottom:14px;
}

.media-modal{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.6);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:9999;
}

.media-modal-content{
    background:#fff;
    width:600px;
    max-height:80vh;
    overflow:auto;
    padding:20px;
    border-radius:10px;
}

.media-grid{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.media-item{
    position:relative;
    cursor:pointer;
}

.media-item img{
    width:100px;
    border-radius:6px;
}

.delete-btn{
    position:absolute;
    top:0;
    right:0;
    background:red;
    color:#fff;
    border:none;
    cursor:pointer;
    padding:2px 6px;
    font-size:12px;
}
.upload-box{
    border:2px dashed #ccc;
    padding:20px;
    text-align:center;
    margin-bottom:15px;
    cursor:pointer;
    border-radius:8px;
}

.upload-box:hover{
    border-color:#000;
}
/* =========================
   TRENDING WORDS
========================= */

.trending-words{
    margin-top:20px;
    display:flex;
    justify-content:center;
    gap:12px;
    flex-wrap:wrap;
    font-size:14px;
    color:#64748b;
}

.trending-words a{
    text-decoration:none;
    color:#111;
    font-weight:500;
    transition:0.2s;
}

.trending-words a:hover{
    color:var(--primary);
}
.word-origin{
    font-size:14px;
    color:#475569;
    margin-bottom:10px;
}

.word-evolution{
    font-size:14px;
    color:#64748b;
    margin-bottom:12px;
}

.word-perspective{
    font-size:13px;
    color:#94a3b8;
    font-style:italic;
}
.word-meta{
    margin-top:20px;
    text-align:center;
}

/* 🔥 THIS FIXES EVERYTHING */
.meta-row{
    margin-bottom:10px;
    font-size:15px;
    color:#374151;
}

/* keep inline naturally */
.meta-label{
    font-weight:600;
    margin-right:4px;
}

.meta-value{
    color:#64748b;
}
/* =========================
   HTML SITEMAP
========================= */

.sitemap-word-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:12px;
    max-width:1000px;
    margin:0 auto;
}

.sitemap-word-link{
    display:block;
    padding:12px 16px;
    background:var(--bg-card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    color:var(--text-main);
    text-decoration:none;
    transition:0.2s ease;
}

.sitemap-word-link:hover{
    border-color:var(--primary);
    color:var(--primary);
    transform:translateY(-2px);
}

@media(max-width:900px){
    .sitemap-word-grid{
        grid-template-columns:repeat(3, 1fr);
    }
}

@media(max-width:600px){
    .sitemap-word-grid{
        grid-template-columns:repeat(2, 1fr);
    }
}

@media(max-width:420px){
    .sitemap-word-grid{
        grid-template-columns:1fr;
    }
}
/* =========================
   SITE FOOTER
========================= */

.site-footer{
    margin-top:70px;
    background:#fff;
    border-top:1px solid var(--border);
}

.site-footer-inner{
    min-height:110px;
    padding:28px 0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:30px;
}

.site-footer-brand{
    text-align:left;
}

.site-footer-name{
    color:var(--secondary);
    font-family:'Playfair Display', serif;
    font-size:19px;
    font-weight:600;
    letter-spacing:.4px;
}

.site-footer-tagline{
    margin-top:5px;
    color:var(--text-muted);
    font-size:13px;
}

.site-footer-nav{
    display:flex;
    align-items:center;
    gap:24px;
}

.site-footer-nav a{
    color:var(--secondary);
    font-size:14px;
    font-weight:500;
    text-decoration:none;
    transition:.2s ease;
}

.site-footer-nav a:hover{
    color:var(--primary);
}

.site-footer-bottom{
    padding:16px 0 20px;
    border-top:1px solid var(--border);
    text-align:center;
    color:var(--text-muted);
    font-size:13px;
}

@media(max-width:768px){

    .site-footer-inner{
        flex-direction:column;
        text-align:center;
        padding:30px 0;
        gap:20px;
    }

    .site-footer-brand{
        text-align:center;
    }

    .site-footer-nav{
        justify-content:center;
        flex-wrap:wrap;
        gap:14px 22px;
    }
}
/* =========================
   FINAL FRONTEND UX OVERRIDES
========================= */

/* HOME — WORD OF THE DAY */
.word-card-day{
    width:calc(100% - 32px);
    max-width:620px;
    margin:38px auto 0;
    padding:32px 36px;
}

.word-card-day h2{
    color:var(--primary);
    font-size:38px;
    line-height:1.15;
    overflow-wrap:anywhere;
}

.word-meta{
    max-width:550px;
    margin:20px auto 0;
}

.meta-row{
    margin-bottom:10px;
    line-height:1.55;
}

.meta-label{
    color:var(--secondary);
    font-weight:600;
}

.meta-value{
    color:var(--text-muted);
}

.word-card-day .view-btn{
    margin-top:10px;
}
/* =========================
   SINGLE WORD PAGE — DESKTOP
========================= */

.word-page-container{
    max-width:1180px;
}

.word-page{
    display:grid;
    grid-template-columns:240px minmax(0, 1fr);
    align-items:start;

    background:var(--bg-card);
    border:1px solid var(--border);
    border-radius:20px;

    box-shadow:0 18px 50px rgba(25,38,54,0.06);
}

/* SIDEBAR */
.word-page .sidebar{
    width:auto;
    min-width:0;
    height:auto;

    position:sticky;
    top:20px;

    padding:30px 22px;

    background:#fbfaf7;
    border-right:1px solid var(--border);
    border-radius:20px 0 0 20px;
}

.word-page .sidebar-logo img{
    width:100%;
    max-width:140px;
    height:auto;
}

/* CONTENT */
.word-page .content{
    width:auto;
    min-width:0;
    padding:40px 48px;
}

.word-page .word-title{
    margin:0 0 18px;
    color:var(--secondary);

    font-family:'Playfair Display', serif;
    font-size:52px;
    line-height:1.08;
}

/* MAIN WORD INFORMATION */
.word-page .word-content-layout{
    display:grid;
    grid-template-columns:minmax(0, 1fr) 220px;
    gap:36px;
    align-items:start;
}

.word-page .word-table{
    min-width:0;
    width:100%;
}

.word-page .word-table .row{
    display:grid;
    grid-template-columns:180px minmax(0, 1fr);

    gap:20px;
    margin:0;
    padding:17px 0;

    border-bottom:1px solid var(--border);
}

.word-page .word-table .label{
    width:auto;
    color:var(--secondary);
    font-weight:600;
}

.word-page .word-table .value{
    min-width:0;
    color:var(--text-muted);

    font-size:15px;
    line-height:1.7;

    overflow-wrap:anywhere;
}

.word-page .word-image-wrap{
    width:100%;
    max-width:220px;
}

.word-page .word-image{
    display:block;
    width:100%;
    height:auto;

    border:1px solid var(--border);
    border-radius:14px;
}

.word-page .narrative{
    padding:24px;

    background:#fbfaf7;
    border:1px solid var(--border);
    border-radius:14px;
}

.word-page .narrative p{
    color:var(--text-muted);
    font-size:15px;
    line-height:1.8;
}
/* =========================
   SINGLE WORD PAGE — MOBILE
========================= */

@media(max-width:768px){

    .word-page-container{
        width:100%;
        max-width:none;

        margin-top:18px !important;
        padding-left:12px;
        padding-right:12px;
    }

    .word-page{
        display:block;
        width:100%;

        border-radius:16px;
    }

    /* SIDEBAR BECOMES TOP PANEL */
    .word-page .sidebar{
        position:static;

        width:100%;
        min-width:0;
        height:auto;

        padding:18px 16px;

        border-right:0;
        border-bottom:1px solid var(--border);
        border-radius:16px 16px 0 0;
    }

    .word-page .sidebar-logo{
        margin-bottom:12px;
        text-align:center;
    }

    .word-page .sidebar-logo img{
        width:auto;
        max-width:105px;
        margin:0 auto;
    }

    .word-page .sidebar-back{
        display:block;
        margin-bottom:15px;

        text-align:center;
        font-size:13px;
    }

    .word-page .sidebar-section{
        margin-top:12px;
    }

    .word-page .sidebar-title{
        margin-bottom:10px;
        text-align:center;
    }

    /* RELATED WORDS BECOME HORIZONTAL */
    .word-page .sidebar-links{
        display:flex;
        flex-direction:row;
        flex-wrap:nowrap;

        gap:8px;
        overflow-x:auto;

        padding:2px 0 7px;

        scrollbar-width:thin;
    }

    .word-page .sidebar-link{
        flex:0 0 auto;
        white-space:nowrap;
    }

    /* MAIN CONTENT */
    .word-page .content{
        width:100%;
        min-width:0;

        padding:24px 18px 30px;
    }

    .word-page .word-title{
        margin-bottom:12px;

        text-align:center;
        font-size:clamp(34px, 11vw, 44px);

        overflow-wrap:anywhere;
    }

    .word-page .word-categories{
        text-align:center;
        font-size:13px;
        line-height:1.6;
    }

    .word-page .word-divider{
        margin:22px 0;
    }

    /* TABLE STACKS PROPERLY */
    .word-page .word-content-layout{
        display:block;
    }

    .word-page .word-table .row{
        display:grid;
        grid-template-columns:1fr;

        gap:5px;
        margin:0;
        padding:14px 0;
    }

    .word-page .word-table .label{
        width:auto;

        color:var(--primary);

        font-size:11px;
        font-weight:700;
        letter-spacing:.8px;
        text-transform:uppercase;
    }

    .word-page .word-table .value{
        width:100%;

        color:var(--secondary);

        font-size:15px;
        line-height:1.65;

        overflow-wrap:anywhere;
        word-break:normal;
    }

    .word-page .word-image-wrap{
        width:100%;
        max-width:320px;

        margin:22px auto 0;
    }

    .word-page .narrative{
        padding:20px;
    }

    .word-page .narrative p{
        font-size:15px;
        line-height:1.75;
    }

    .word-page .related-bottom{
        margin-top:28px;
        padding-top:22px;
    }

    .word-page .related-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:9px;
    }

}
@media(max-width:480px){

    .word-page .related-grid{
        grid-template-columns:1fr;
    }

}
/* =========================
   HOME — MOBILE
========================= */

@media(max-width:768px){

    .home-container{
        padding:38px 16px 0;
    }

    .hero-logo{
        margin-bottom:26px;
    }

    .main-logo{
        width:min(290px, 82vw);
        max-width:100%;
    }

    .tagline{
        margin-top:14px;

        padding:0 8px;

        font-size:17px;
        line-height:1.5;
    }

    .search-wrapper{
        width:100%;
        max-width:100%;

        margin:22px auto 14px;
    }

    .search-box{
        width:100%;

        gap:8px;
        padding:11px 11px 11px 18px;
    }

    .search-box input{
        min-width:0;

        font-size:16px;
    }

    .search-box button{
        flex:0 0 auto;

        padding:10px 17px;
        font-size:14px;
    }

    .trending-words{
        padding:0 5px;

        gap:7px 10px;

        font-size:12px;
        line-height:1.5;
    }

    .trending-words a{
        overflow-wrap:anywhere;
    }

    .word-card-day{
        width:100%;
        max-width:620px;

        margin:30px auto 0;
        padding:24px 18px;

        border-radius:16px;
    }

    .word-card-day h2{
        font-size:30px;
        line-height:1.18;

        overflow-wrap:anywhere;
    }

    .word-meta{
        margin-top:17px;
    }

    .meta-row{
        font-size:14px;
        line-height:1.55;
    }

}
@media(max-width:640px){

    .navbar .container{
        padding-left:14px;
        padding-right:14px;
        gap:12px;
    }

    .nav-logo img{
        height:38px !important;
        width:auto;
    }

    .nav-links{
        gap:11px;
    }

    .nav-links a{
        white-space:nowrap;
        font-size:13px;
    }

    .nav-links .btn{
        padding:5px 9px;
        font-size:12px;
    }

}
/* =========================
   SIMILAR WORDS — CHIPS
========================= */

.similar-word-links{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
}

.similar-word-link{
    display:inline-flex;
    align-items:center;

    padding:7px 11px;

    background:#fbfaf7;
    border:1px solid var(--border);
    border-radius:999px;

    color:var(--secondary);
    text-decoration:none;

    font-size:13px;
    line-height:1.25;
    font-weight:500;

    transition:
        color .2s ease,
        border-color .2s ease,
        background-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.similar-word-link:hover{
    color:var(--secondary);

    background:rgba(205,168,97,.14);
    border-color:var(--primary);

    transform:translateY(-1px);

    box-shadow:
        0 5px 14px rgba(25,38,54,.07);
}

.similar-word-link:focus-visible{
    outline:2px solid var(--primary);
    outline-offset:2px;
}


/* MOBILE */
@media(max-width:768px){

    .similar-word-links{
        gap:7px;
    }

    .similar-word-link{
        padding:7px 10px;
        font-size:12.5px;
    }

}