/* =========================
   THEME VARIABLES (GLOBAL CONTROL)
========================= */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;

    --text-main: #1e293b;
    --text-muted: #64748b;

    --primary: #6366f1;
    --primary-hover: #4f46e5;

    --border: #e2e8f0;

    --radius: 12px;
}

/* =========================
   GLOBAL
========================= */

html, body {
    height: 100%;
}
/* ADMIN LAYOUT ONLY */
.admin-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
}

/* MAIN CONTENT (for sticky footer) */
.main-content {
    min-height: calc(100vh - 120px);
}

/* 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);
}

/* =========================
   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: 80px;
}

/* LOGO */
.hero-logo {
    margin-bottom: 30px;
}

.main-logo {
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tagline {
    margin-top: 12px;
    font-size: 18px;
    color: #666;
}

/* SEARCH */
.search-wrapper {
    max-width: 700px;
    margin: 30px auto;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 14px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    gap: 10px;
}

.search-icon {
    font-size: 18px;
    color: #888;
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 16px;
    background: transparent;
}

.search-box button {
    border: none;
    background: #eee;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
}
.word-card-day {
    margin: 60px auto;
    max-width: 520px;
    background: #fff;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid #eee;
}

.word-card-day .badge {
    font-size: 12px;
    color: #888;
    display: block;
    margin-bottom: 10px;
}

.word-card-day h2 {
    font-size: 30px;
    margin: 10px 0;
}

.word-card-day p {
    color: #666;
    font-size: 15px;
}

.view-btn {
    display: inline-block;
    margin-top: 10px;
    font-weight: 500;
}
/* 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 {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.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;
}