/* ===================================
   WordMammoth — Main Stylesheet
   Colors: warm brown, cream, orange accent
   =================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brown-dark:   #3b2a1a;
    --brown-mid:    #5c3d1e;
    --brown-light:  #8b5e3c;
    --orange:       #e07b2a;
    --orange-light: #f5a44a;
    --cream:        #fdf6ec;
    --cream-dark:   #f0e4cc;
    --text-dark:    #2b1d0e;
    --text-mid:     #5a3e28;
    --text-light:   #9e7a5a;
    --white:        #ffffff;
    --pill-bg:      #fff3e0;
    --pill-hover:   #e07b2a;
    --shadow:       0 2px 12px rgba(59,42,26,0.12);
    --radius:       10px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HERO MAMMOTH IMAGE ===== */
.hero-mammoth {
    width: 220px;
    height: 220px;
    object-fit: contain;
    margin-bottom: 0;
    filter: drop-shadow(0 4px 12px rgba(59,42,26,0.2));
}
@media (max-width: 600px) {
    .hero-mammoth { width: 100px; height: 100px; }
}

/* ===== HEADER ===== */
.site-header {
    background: var(--brown-dark);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cream);
}
.logo-icon { font-size: 24px; line-height: 1; }
.logo-text {
    font-size: 20px;
    font-weight: 400;
    color: var(--cream-dark);
    letter-spacing: -0.3px;
}
.logo-text strong {
    color: var(--orange-light);
    font-weight: 700;
}
.header-nav { display: flex; gap: 20px; }
.nav-link {
    color: var(--cream-dark);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.nav-link:hover { opacity: 1; color: var(--orange-light); }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(160deg, var(--brown-dark) 0%, var(--brown-mid) 60%, var(--brown-light) 100%);
    padding: 0 40px;
    text-align: left;
    height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-inner {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 48px;
}
.hero-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-right {
    flex: 1;
    min-width: 0;
}

.hero-title {
    color: var(--cream);
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-sub {
    color: var(--cream-dark);
    font-size: clamp(13px, 2vw, 17px);
    opacity: 0.85;
    margin-bottom: 12px;
}

/* Search box */
.search-form { width: 100%; }
.search-box {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 50px;
    padding: 6px 6px 6px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
}
.search-icon { font-size: 18px; flex-shrink: 0; }
.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    font-family: inherit;
    color: var(--text-dark);
    background: transparent;
    padding: 4px 0;
}
.search-input::placeholder { color: #bbb; }
.search-btn {
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}
.search-btn:hover { background: var(--orange-light); }
.search-btn:active { transform: scale(0.97); }

/* Example words */
.example-words {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}
.example-label { color: var(--cream-dark); font-size: 13px; opacity: 0.7; }
.example-word {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--cream);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.example-word:hover { background: var(--orange); border-color: var(--orange); }

/* ===== RESULTS SECTION ===== */
.results-section {
    flex: 1;
    padding: 30px 20px 50px;
    background: var(--cream);
}
.results-inner { max-width: 900px; margin: 0 auto; }

.word-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.word-heading h2 {
    font-size: clamp(18px, 3vw, 26px);
    color: var(--brown-dark);
    font-weight: 600;
}
#word-display {
    color: var(--orange);
    font-style: italic;
}
.back-btn {
    background: var(--cream-dark);
    border: 1px solid var(--brown-light);
    color: var(--brown-mid);
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.back-btn:hover { background: var(--brown-light); color: white; }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--cream-dark);
    padding-bottom: 0;
}
.tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--orange); }
.tab.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
    font-weight: 600;
}

/* Tab panels */
.tab-panels { min-height: 180px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Loading spinner */
.panel-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-size: 14px;
    padding: 24px 0;
}
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--cream-dark);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Word pills */
.word-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}
.word-pill {
    background: var(--pill-bg);
    border: 1px solid var(--cream-dark);
    color: var(--brown-mid);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    text-decoration: none;
    display: inline-block;
}
.word-pill:hover {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
    transform: translateY(-1px);
}

/* Relevance tiers */
.word-pill.tier-1 { font-weight: 600; font-size: 15px; }
.word-pill.tier-2 { font-weight: 500; }
.word-pill.tier-3 { font-weight: 400; opacity: 0.85; }

/* Definition cards */
.definition-cards { display: flex; flex-direction: column; gap: 16px; }
.def-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--orange);
}
.def-part-of-speech {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--orange);
    margin-bottom: 10px;
}
.def-phonetic {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
    font-style: italic;
}
.def-meaning {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--cream-dark);
    padding-bottom: 10px;
}
.def-meaning:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.def-text {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 6px;
}
.def-example {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.5;
}
.def-example::before { content: '"'; }
.def-example::after { content: '"'; }

/* Empty / Error */
.empty-msg {
    color: var(--text-light);
    font-size: 14px;
    padding: 24px 0;
    font-style: italic;
}

/* ===== FEATURES BAR ===== */
.features-bar {
    background: var(--brown-dark);
    padding: 20px;
    display: none;
}
.features-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cream-dark);
    font-size: 13px;
    opacity: 0.85;
}
.feature-icon { font-size: 18px; }

/* ===== FOOTER ===== */
.site-footer {
    background: #2b1d0e;
    padding: 8px 20px;
    text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-logo {
    font-size: 18px;
    color: var(--cream);
    margin-bottom: 6px;
}
.footer-copy {
    color: #9e7a5a;
    font-size: 13px;
    line-height: 1.5;
}

/* ===== WORD OF THE DAY ===== */
.wotd-card {
    margin-top: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 560px;
}
.wotd-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--orange-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}
.wotd-word {
    background: var(--orange);
    border: none;
    color: white;
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.wotd-word:hover { background: var(--orange-light); }
.wotd-def {
    font-size: 13px;
    color: var(--cream-dark);
    opacity: 0.8;
    font-style: italic;
    flex: 1;
    min-width: 120px;
    text-align: left;
}

/* ===== SEARCH HISTORY ===== */
.history-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.history-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.history-pill {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--cream);
    border-radius: 14px;
    padding: 3px 12px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.history-pill:hover { background: var(--orange); border-color: var(--orange); }
.clear-history-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
    border-radius: 50%;
    width: 22px; height: 22px;
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.clear-history-btn:hover { color: var(--orange-light); border-color: var(--orange-light); }

/* ===== COPY BUTTON ===== */
.copy-all-btn {
    margin-top: 14px;
    background: none;
    border: 1px solid var(--cream-dark);
    color: var(--text-light);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.copy-all-btn:hover { background: var(--brown-light); color: white; border-color: var(--brown-light); }
.copy-all-btn.copied { background: #4caf50; color: white; border-color: #4caf50; }

/* ===== SENTENCES ===== */
.sentence-list { padding: 8px 0; }
.sentence-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--cream-dark);
}
.sentence-item:last-child { border-bottom: none; }
.sentence-pos {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--orange);
    letter-spacing: 0.5px;
    min-width: 60px;
}
.sentence-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
}
.sentence-text mark {
    background: #fff3c4;
    color: var(--brown-dark);
    border-radius: 3px;
    padding: 0 2px;
    font-weight: 600;
}

/* ===== WORD FORMS ===== */
.wf-group { margin-bottom: 20px; }
.wf-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* ===== COLLOCATIONS ===== */
.colloc-group { margin-bottom: 22px; }
.colloc-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 8px;
}
.colloc-phrase {
    font-style: italic;
    color: var(--text-light);
    font-weight: 400;
    margin-left: 6px;
}

/* ===== TRANSLATE BAR ===== */
.translate-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cream-dark);
    margin-bottom: 4px;
}
.translate-label { font-size: 18px; line-height: 1; }
.lang-select {
    padding: 6px 10px;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
}
.lang-select:focus { outline: 2px solid var(--orange); border-color: transparent; }
.translate-go-btn {
    padding: 6px 18px;
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.translate-go-btn:hover { background: var(--orange-light); }
.translate-go-btn:disabled { opacity: 0.6; cursor: default; }
.translate-reset-btn {
    padding: 6px 14px;
    background: transparent;
    color: var(--text-mid);
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.translate-reset-btn:hover { background: var(--cream-dark); }

/* ===== LEGACY MOBILE (superseded below) ===== */
@media (max-width: 600px) {
    .tabs { gap: 2px; }
    .tab { padding: 8px 12px; font-size: 13px; }
    .word-pill { font-size: 13px; padding: 5px 13px; }
    .def-card { padding: 16px; }
    .features-inner { gap: 16px; }
    .feature-item { font-size: 12px; }
    .translate-bar { gap: 6px; }
}

/* ===================================
   WORDHIPPO-INSPIRED REDESIGN
   Clean white / light gray look
   =================================== */

/* Light page background */
body { background: #f0f0f0; }

/* Light header — white with orange accent border */
.site-header {
    background: #fff;
    border-bottom: 3px solid var(--orange);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.logo { color: var(--brown-dark); }
.logo-text { color: var(--brown-dark); }
.logo-text strong { color: var(--orange); }
.nav-link { color: var(--brown-mid); opacity: 1; }
.nav-link:hover { color: var(--orange); opacity: 1; }

/* Hero — auto height, centered, transparent bg */
.hero {
    background: transparent;
    height: auto;
    min-height: 0;
    flex: 1;
    display: block;
    overflow: visible;
    padding: 48px 20px 36px;
    text-align: center;
}

/* White card container */
.wh-center {
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 28px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.09);
}

/* Brand / logo block */
.wh-logo-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 26px;
}
.wh-mammoth {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(59,42,26,0.18));
}
.wh-title-block { text-align: left; }
.wh-brand {
    display: block;
    font-size: 30px;
    font-weight: 400;
    color: var(--brown-dark);
    line-height: 1.1;
    letter-spacing: -0.3px;
}
.wh-brand strong { color: var(--orange); font-weight: 700; }
.wh-tagline {
    display: block;
    font-size: 13px;
    color: #888;
    margin-top: 3px;
}

/* Search form: [dropdown][input___][Find] all on one row */
.wh-form {
    display: block;
    margin-bottom: 18px;
}
.wh-search-row {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--orange);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.wh-select {
    border: none;
    border-right: 1px solid #e0cfc0;
    background: #faf6f2;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--brown-dark);
    cursor: pointer;
    outline: none;
    min-width: 152px;
    flex-shrink: 0;
}
.wh-select:focus { outline: none; }
.wh-input {
    border: none;
    flex: 1;
    padding: 13px 16px;
    font-size: 17px;
    outline: none;
    font-family: inherit;
    color: var(--text-dark);
    background: #fff;
    min-width: 0;
}
.wh-input::placeholder { color: #bbb; }
.wh-find-btn {
    border: none;
    background: var(--orange);
    color: #fff;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s;
    white-space: nowrap;
}
.wh-find-btn:hover { background: var(--orange-light); }
.wh-find-btn:active { background: var(--brown-mid); }

/* Example words — light theme */
.wh-examples {
    justify-content: center;
    margin-bottom: 16px;
}
.wh-examples .example-label { color: #999; font-size: 13px; }
.wh-examples .example-word {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    color: var(--brown-mid);
}
.wh-examples .example-word:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

/* WotD — light card override */
.wh-center .wotd-card {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}
.wh-center .wotd-label { color: var(--orange); }
.wh-center .wotd-def { color: var(--text-light); }

/* History — light override */
.wh-center .history-row { justify-content: center; }
.wh-center .history-pill {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    color: var(--brown-mid);
}
.wh-center .history-pill:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}
.wh-center .clear-history-btn {
    border-color: var(--cream-dark);
    color: var(--text-light);
}
.wh-center .clear-history-btn:hover {
    color: var(--orange);
    border-color: var(--orange);
}

/* Results section sits on light bg — unchanged, just ensure bg consistent */
.results-section { background: var(--cream); }

/* Mobile — WH layout */
@media (max-width: 600px) {
    .hero { padding: 16px 10px 20px; }
    .wh-center { padding: 22px 14px 18px; border-radius: 8px; }
    .wh-logo-block { gap: 10px; margin-bottom: 18px; }
    .wh-mammoth { width: 44px; height: 44px; }
    .wh-brand { font-size: 24px; }
    .wh-search-row { flex-wrap: wrap; }
    .wh-select {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0cfc0;
        padding: 10px 14px;
        min-width: 0;
    }
    .wh-input { width: 100%; padding: 11px 14px; font-size: 16px; }
    .wh-find-btn { width: 100%; padding: 12px; font-size: 15px; }
    .search-input { font-size: 16px; }
}
