/* ============================================
   Sentences — Clean & Modern Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #fafbfc;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --card-bg: #ffffff;
    --section-bg: #f3f4f6;
    --highlight: #fef3c7;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

a:visited {
    color: var(--accent);
}

/* ============================================
   Header
   ============================================ */

header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    gap: 20px;
}

header h1 {
    font-size: 22px;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

header h1 a {
    color: var(--text);
    text-decoration: none;
}

header h1 a:hover {
    color: var(--accent);
}

/* ============================================
   Search Bar
   ============================================ */

.header-search {
    flex-grow: 1;
    max-width: 480px;
}

.header-search form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input[type="text"] {
    width: 100%;
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    transition: var(--transition);
    outline: none;
}

.header-search input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search button {
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.header-search button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Suggestion Box */
#suggestion-box {
    position: absolute;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    display: none;
    z-index: 2000;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

#suggestion-box div {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

#suggestion-box div:hover {
    background: var(--accent);
    color: #fff;
}

/* ============================================
   Layout Container
   ============================================ */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   Breadcrumbs
   ============================================ */

nav.breadcrumbs {
    font-size: 13px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

nav.breadcrumbs a {
    color: var(--text-muted);
}

nav.breadcrumbs a:hover {
    color: var(--accent);
}

/* ============================================
   Home Page
   ============================================ */

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.home-section {
    margin-bottom: 32px;
}

.home-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
    letter-spacing: -0.3px;
}

.word-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.word-list li {
    margin: 0;
}

.word-list li a {
    display: inline-block;
    padding: 5px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
}

.word-list li a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.hit-count {
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
    margin-left: 2px;
    font-weight: 400;
}

/* Browse Dictionary */
.all-words-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.word-columns {
    column-count: 3;
    column-gap: 24px;
    padding: 0;
    border: none;
    background: none;
}

.word-item {
    padding: 4px 0;
    break-inside: avoid;
}

.word-item a {
    font-size: 13px;
    color: var(--text);
    transition: var(--transition);
}

.word-item a:hover {
    color: var(--accent);
    padding-left: 4px;
}

/* Pagination */
.pagination {
    margin: 24px 0 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.mini-pagination {
    font-size: 13px;
    margin-top: 12px;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none !important;
    color: var(--text) !important;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition);
    cursor: pointer;
}

.btn:hover {
    background: var(--section-bg);
    border-color: var(--accent);
    color: var(--accent) !important;
}

.page-info {
    margin: 0 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   Word Page
   ============================================ */

.word-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.word-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.word-pos {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 20px 0;
}

.meaning {
    font-size: 15px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--section-bg);
    border-radius: var(--radius);
    line-height: 1.7;
}

.meaning strong {
    color: var(--text);
    font-weight: 600;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 28px 0 16px;
    letter-spacing: -0.3px;
}

.sentences {
    list-style-type: none;
    padding: 0;
    margin: 0;
    counter-reset: sentence-counter;
}

.sentences li {
    counter-increment: sentence-counter;
    padding: 14px 16px 14px 48px;
    margin-bottom: 8px;
    background: var(--section-bg);
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.7;
    position: relative;
    transition: var(--transition);
}

.sentences li::before {
    content: counter(sentence-counter);
    position: absolute;
    left: 16px;
    top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(37, 99, 235, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sentences li:hover {
    background: var(--highlight);
}

.sentences li strong {
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   Admin Dashboard
   ============================================ */

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-section {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: var(--card-bg);
}

.admin-section h3 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    background: none;
    padding: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
}

table.admin-table th,
table.admin-table td {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
}

table.admin-table th {
    background: var(--section-bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

table.admin-table tr:hover {
    background: var(--section-bg);
}

/* ============================================
   Forms
   ============================================ */

input[type="text"],
input[type="password"] {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    resize: vertical;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    background: var(--section-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

button:hover {
    background: var(--border);
}

/* ============================================
   Footer
   ============================================ */

footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 24px 0;
    margin-top: 60px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 10px;
    }

    .header-search {
        max-width: 100%;
        order: 3;
        width: 100%;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .word-columns {
        column-count: 2;
    }

    .word-title {
        font-size: 24px;
    }

    .word-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .word-columns {
        column-count: 1;
    }

    .container {
        padding: 16px;
    }
}
