/* Barsukas Web Interface Styles */

:root {
    --primary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --light-bg: #ecf0f1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

.navbar {
    background-color: var(--primary-color) !important;
    margin-bottom: 2rem;
}

.navbar-brand {
    font-weight: bold;
}

.stat-card {
    border-left: 4px solid var(--primary-color);
}

.lemma-card {
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

.lemma-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.difficulty-badge {
    font-weight: bold;
    padding: 0.25rem 0.5rem;
}

.slash-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

.translation-table th {
    background-color: var(--light-bg);
}

.override-table th {
    background-color: var(--light-bg);
}

.effective-level {
    font-weight: bold;
}

.override-form {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.search-form {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pagination-container {
    margin-top: 2rem;
}

.flash-messages {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.btn-sm {
    font-size: 0.875rem;
}

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

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

.form-label {
    font-weight: 500;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.text-muted-small {
    font-size: 0.875rem;
    color: #6c757d;
}

.lemma-definition {
    font-style: italic;
    color: #495057;
}

.pos-badge {
    font-family: monospace;
    font-size: 0.85rem;
}

/* Pinyin Ruby Text Styling */
/* Elegant, minimal display inspired by Japanese furigana */

ruby {
    /* Safari compatibility: use -webkit prefix and remove unsupported ruby-align */
    -webkit-ruby-position: before;
    ruby-position: over;
    text-align: center;
}

rt {
    font-size: 0.7em;
    color: #6c757d;
    font-weight: normal;
    letter-spacing: 0.05em;
    line-height: 1.2;
    /* Safari needs explicit display and positioning */
    display: block;
    text-align: center;
}

/* Ensure proper spacing and centering for Chinese text with pinyin */
.chinese-with-pinyin ruby {
    display: inline-block;
    margin-right: 0.65em;
    text-align: center;
}

/* Make pinyin slightly larger in headings for better readability */
h1 ruby rt, h2 ruby rt, h3 ruby rt {
    font-size: 0.55em;
}

/* Ensure pinyin doesn't get too large in very small text */
.small ruby rt, small ruby rt {
    font-size: 0.6em;
}

/* Optional: Add a subtle separator line between Chinese and pinyin */
ruby.with-separator {
    position: relative;
}

ruby.with-separator rt {
    border-top: 1px solid rgba(108, 117, 125, 0.2);
    padding-top: 0.1em;
    margin-top: 0.1em;
}

/* Japanese Romaji Styling - display below like Chinese pinyin */
.japanese-with-romaji ruby {
    display: inline-block;
    margin-right: 0.65em;
    text-align: center;
}

/* Utility Classes - Common patterns extracted from templates */

/* Scrollable containers */
.scrollable-sm {
    max-height: 200px;
    overflow-y: auto;
}

.scrollable-md {
    max-height: 400px;
    overflow-y: auto;
}

.scrollable-lg {
    max-height: 600px;
    overflow-y: auto;
}

/* Terminal/code output styling */
.terminal-output {
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    padding: 1rem;
    border-radius: 0.25rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Audio player styling */
.audio-player-inline {
    width: 200px;
}

.audio-player-large {
    width: 100%;
}

/* Small text utilities */
.text-xs {
    font-size: 0.7rem;
}

.text-sm {
    font-size: 0.85rem;
}

/* Cursor utilities */
.cursor-pointer {
    cursor: pointer;
}

/* Inline form styling */
.inline-form {
    display: inline-block;
}

/* Status badges with consistent sizing */
.status-badge {
    font-size: 0.8rem;
}

/* Filter form styling (for list pages) */
.filter-form {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

/* Review container styling */
.review-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Expected text display (for audio review) */
.expected-text-display {
    font-size: 2rem;
    font-weight: 500;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* ---- Benchmarks section ---- */
.score-badge {
    display: inline-flex;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.score-excellent { background-color: #1b5e20; }
.score-good { background-color: #4caf50; }
.score-average { background-color: #ff9800; }
.score-below-average { background-color: #f44336; }
.score-poor { background-color: #b71c1c; }

.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
