/* Kadazan Dictionary — Public Styles */

.kd-wrap {
    max-width: 800px;
    margin: 0 auto 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.kd-header {
    text-align: center;
    padding: 2rem 1rem 1.2rem;
    background: linear-gradient(135deg, #1a5c3a 0%, #2d8a5e 100%);
    border-radius: 14px 14px 0 0;
    color: #fff;
}
.kd-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}
.kd-icon { font-size: 1.8rem; }
.kd-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    border: none;
}
.kd-subtitle {
    margin: 0;
    font-size: 0.88rem;
    color: #ffffff !important;
    opacity: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Search row */
.kd-search-row {
    display: flex;
    gap: 10px;
    padding: 1rem;
    background: #f7f5f0;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    flex-wrap: wrap;
}
.kd-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.kd-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}
.kd-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 36px 10px 38px;
    font-size: 1rem;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color .2s;
    background: #fff;
}
.kd-input:focus { border-color: #2d8a5e; }
.kd-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1rem;
    padding: 2px 4px;
}
.kd-clear-btn:hover { color: #333; }
.kd-select {
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.kd-select:focus { border-color: #2d8a5e; outline: none; }

/* Results area */
.kd-results {
    border: 1px solid #ddd;
    border-top: none;
    min-height: 80px;
    background: #fff;
}
.kd-hint, .kd-no-results {
    text-align: center;
    color: #888;
    padding: 2rem;
    font-size: 0.95rem;
}

/* Word card */
.kd-card {
    border-bottom: 1px solid #eee;
    padding: 1.1rem 1.2rem;
    transition: background .15s;
}
.kd-card:last-child { border-bottom: none; }
.kd-card:hover { background: #fafef8; }
.kd-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.kd-word {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a5c3a;
    margin: 0 0 2px;
}
.kd-pos {
    display: inline-block;
    font-size: 0.72rem;
    font-style: italic;
    color: #2d8a5e;
    background: #e8f5ee;
    padding: 2px 7px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 6px;
}
.kd-pronunciation {
    font-size: 0.88rem;
    color: #5a8a6e;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    letter-spacing: 0.02em;
    margin: 0 0 4px;
}
.kd-pronunciation::before { content: "/ "; }
.kd-pronunciation::after  { content: " /"; }
.kd-meaning {
    font-size: 1rem;
    color: #333;
    margin: 4px 0 0;
}
.kd-example {
    font-size: 0.88rem;
    color: #666;
    font-style: italic;
    margin: 6px 0 0;
    padding-left: 10px;
    border-left: 3px solid #d4edde;
}
.kd-dialect-tag {
    font-size: 0.72rem;
    color: #888;
    background: #f0f0f0;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Audio player */
.kd-audio-wrap {
    margin-top: 10px;
}
.kd-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a5c3a;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.kd-play-btn:hover  { background: #2d8a5e; }
.kd-play-btn:active { transform: scale(0.97); }
.kd-play-btn.playing { background: #c0392b; }
.kd-play-icon { font-size: 0.9rem; }

/* Loading spinner */
.kd-loading {
    text-align: center;
    padding: 2rem;
    color: #2d8a5e;
}
.kd-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #d4edde;
    border-top-color: #2d8a5e;
    border-radius: 50%;
    animation: kd-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes kd-spin { to { transform: rotate(360deg); } }

/* Footer */
.kd-footer {
    text-align: center;
    font-size: 0.78rem;
    color: #aaa;
    padding: 0.7rem 1rem;
    background: #f7f5f0;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 14px 14px;
}
.kd-footer a { color: #2d8a5e; text-decoration: none; }
.kd-footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 480px) {
    .kd-search-row  { flex-direction: column; }
    .kd-select      { width: 100%; }
    .kd-card-top    { flex-direction: column; }
    .kd-tabs        { gap: 0; }
    .kd-tab         { font-size: 0.82rem; padding: 10px 12px; }
}

/* ── Tabs ──────────────────────────────────────────────────────── */
.kd-tabs {
    display: flex;
    background: #f0ede6;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    gap: 2px;
    padding: 8px 10px 0;
}
.kd-tab {
    background: #e0ddd5;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    transition: background .15s, color .15s;
}
.kd-tab:hover { background: #d0cdc4; }
.kd-tab--active {
    background: #fff;
    color: #1a5c3a;
    border-color: #ddd;
    position: relative;
    z-index: 1;
}
.kd-tab-panel { display: block; }
.kd-tab-panel--hidden { display: none; }

/* ── Conversations ─────────────────────────────────────────────── */
.kd-conv-intro {
    padding: 1rem 1.2rem 0.4rem;
    background: #fff;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 0.92rem;
    color: #444;
}
.kd-conv-group {
    background: #fff;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 0 1.2rem 1rem;
}
.kd-conv-category {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2d8a5e;
    margin: 1.2rem 0 0.6rem;
    padding-bottom: 5px;
    border-bottom: 2px solid #e8f5ee;
}
.kd-conv-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.kd-conv-card {
    background: #fafef8;
    border: 1px solid #d4edde;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background .15s, box-shadow .15s;
}
.kd-conv-card:hover {
    background: #f0faf4;
    box-shadow: 0 2px 8px rgba(45,138,94,.1);
}
.kd-conv-main { flex: 1; }
.kd-conv-kadazan {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a5c3a;
    margin-bottom: 2px;
}
.kd-conv-pronunciation {
    font-size: 0.78rem;
    color: #5a8a6e;
    font-style: italic;
    font-family: Georgia, serif;
    margin-bottom: 3px;
}
.kd-conv-pronunciation::before { content: "/ "; }
.kd-conv-pronunciation::after  { content: " /"; }
.kd-conv-english {
    font-size: 0.88rem;
    color: #555;
}
.kd-conv-card .kd-play-btn {
    padding: 8px 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.kd-conv-card .kd-play-btn .kd-play-icon { font-size: 0.8rem; }
