/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *


 */

:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --accent: #3498db;
    --bg-color: #fcfcfc;
    --text-color: #333;
    --muted-text: #666;
    --border-color: #eee;
    --header-bg: #fff;
    --container-width: 900px;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --serif: 'EB Garamond', Georgia, serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
.main-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links a {
    margin-left: 1.5rem;
    color: var(--muted-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Flash Messages */
.flash {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.flash.notice {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.flash.alert {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Typography & Content */
main {
    flex: 1;
    padding: 2rem 0;
}

h1,
h2,
h3 {
    color: var(--primary);
    margin-top: 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

/* Dictionary Entries List */
.dictionary-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.dictionary-entry {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.dictionary-entry:last-child {
    border-bottom: none;
}

.entry-headword-wrap {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.headwords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: baseline;
}

.headword-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.entry-headword {
    font-family: var(--serif);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.entry-lang-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--muted-text);
    font-weight: 600;
    font-family: var(--sans);
}

.senses-container {
    font-family: var(--serif);
    font-size: 1.2rem;
    padding-left: 1rem;
}

.sense-item {
    margin-bottom: 0.5rem;
}

.sense-number {
    font-weight: 800;
    font-style: italic;
    margin-right: 0.5rem;
}

.grammatical-info {
    font-style: italic;
    color: var(--muted-text);
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.gloss-text {
    color: var(--text-color);
}

/* Forms & UI Elements */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.search-field {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

.sort-links {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--muted-text);
}

.sort-links a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 0.5rem;
}

.sort-links a.active {
    font-weight: 800;
    color: var(--primary);
}

/* Footer */
.main-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--muted-text);
    font-size: 0.85rem;
    text-align: center;
}

/* Pagination */
.pagination {
    margin: 2rem 0;
    text-align: center;
    font-family: var(--sans);
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    margin: 0 2px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--primary);
    border-radius: 4px;
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Detail View Styles */
.dictionary-entry-detail {
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.sense-block {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px dashed var(--border-color);
}

.sense-block:last-child {
    border-bottom: none;
}

.sense-heading {
    margin-bottom: 1rem;
}

.sense-content {
    font-family: var(--serif);
    font-size: 1.3rem;
}

.definitions ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.lang-code {
    font-family: var(--sans);
    font-size: 0.8rem;
    color: var(--muted-text);
}

.traits-section,
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--primary);
}

.traits-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.trait-item dt {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--muted-text);
}

.trait-item dd {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
}

.comment-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.comment-body {
    font-size: 0.95rem;
}

.muted {
    color: var(--muted-text);
    font-style: italic;
}

.comment-form-wrap {
    margin-top: 2rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.actions-bar {
    margin-bottom: 1rem;
    text-align: right;
}

.entry-header {
    margin-bottom: 1rem;
}

/* Administrative & Form Styles */
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.file-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.95rem;
    cursor: pointer;
}

.import-form {
    max-width: 500px;
}
