/* ===================== RESET & BASE ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.5;
}
a { color: #0000EE; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== HEADER ===================== */
.site-header {
    background: #d3d3d3;
    border-bottom: 1px solid #bbb;
}
.nav-bar {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    gap: 25px;
}
.nav-bar a {
    color: #888;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nav-bar a:hover { color: #555; }
.logo-wrap {
    text-align: center;
    padding: 25px 15px 10px;
}
.logo {
    font-size: 32px;
    font-weight: 300;
    color: #e67e22;
    letter-spacing: 1px;
}
.logo strong { font-weight: 700; }
.tagline {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    margin-bottom: 25px;
}

/* ===================== SEARCH ===================== */
.search-section {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 0 15px;
    display: flex;
    gap: 8px;
}
.search-section input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 15px;
}
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 3px;
    background: #e67e22;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:hover { background: #d35400; }
.btn-secondary { background: #e67e22; }

/* ===================== LANGUAGE SWITCHER ===================== */
.lang-switch {
    position: absolute;
    top: 10px;
    right: 15px;
}
.lang-switch select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #fff;
}

/* ===================== MAIN ===================== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px 40px;
}

/* ===================== WORD PAGE ===================== */
.word-header {
    margin: 20px 0 15px;
}
.word-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.word-title {
    font-size: 22px;
    font-weight: 700;
    color: #0000EE;
}
.word-ipa {
    color: #888;
    font-size: 15px;
    font-family: Georgia, serif;
}

/* Audio player button */
.audio-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e67e22;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.audio-btn::after {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #fff;
    margin-left: 2px;
}
.audio-btn:hover { background: #d35400; }

.translations {
    margin: 10px 0 20px 32px;
    list-style: disc;
    color: #333;
}
.translations li { margin-bottom: 3px; }

.section-title {
    color: #888;
    font-size: 18px;
    font-weight: 400;
    margin: 25px 0 10px;
    text-transform: lowercase;
}

.synonyms-list {
    margin-left: 32px;
    list-style: disc;
    color: #0000EE;
}
.synonyms-list li { margin-bottom: 4px; }

/* Phrases table */
.phrases-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.phrases-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}
.phrases-table td:first-child {
    width: 30px;
    padding-left: 0;
}
.phrases-table .phrase-it {
    color: #0000EE;
    font-weight: 600;
}
.phrases-table .phrase-tr {
    color: #555;
    text-align: right;
}

/* ===================== CATEGORY PAGE ===================== */
.category-header {
    margin: 20px 0;
}
.category-title {
    font-size: 20px;
    color: #0000EE;
    margin-bottom: 5px;
}
.category-desc {
    color: #777;
    font-size: 14px;
}

.words-list {
    list-style: none;
    margin-top: 15px;
}
.words-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}
.words-list .w-parola {
    color: #0000EE;
    font-weight: 600;
    min-width: 140px;
}
.words-list .w-ipa {
    color: #888;
    font-family: Georgia, serif;
    font-size: 14px;
    min-width: 100px;
}
.words-list .w-tr {
    color: #333;
    font-size: 14px;
}

/* ===================== HOME ===================== */
.home-search {
    text-align: center;
    margin: 40px 0;
}
.home-search .search-section {
    justify-content: center;
}
.home-categories {
    margin-top: 30px;
}
.home-categories h2 {
    font-size: 18px;
    color: #888;
    margin-bottom: 15px;
    font-weight: 400;
}
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.cat-grid a {
    display: block;
    padding: 10px 14px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #0000EE;
    font-size: 14px;
    border: 1px solid #e0e0e0;
}
.cat-grid a:hover { background: #eee; }

/* ===================== PAGINATION ===================== */
.pagination {
    margin-top: 20px;
    text-align: center;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}
.pagination a { color: #0000EE; }
.pagination span { background: #f5f5f5; color: #888; }

/* ===================== 404 ===================== */
.not-found {
    text-align: center;
    padding: 60px 15px;
}
.not-found h1 { font-size: 48px; color: #ccc; margin-bottom: 10px; }
.not-found p { color: #888; margin-bottom: 20px; }

/* ===================== FOOTER ===================== */
.site-footer {
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-size: 12px;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 600px) {
    .nav-bar { gap: 12px; }
    .search-section { flex-wrap: wrap; }
    .search-section input { width: 100%; }
    .words-list li { flex-wrap: wrap; }
}
