/* LangLex - Custom CMS Styles */

/* Reset & base */
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #222;
    margin: 0;
    padding: 0;
    background: #fafafa;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* Links */
a { color: #2e5cb8; text-decoration: none; }
a:hover { color: #ed1c24; text-decoration: underline; }

/* Header */
.site-header {
    background: #060a14 url('../images/banner-dark-2.svg') center center / cover no-repeat;
    color: #e8f0ff;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid rgba(237, 28, 36, 0.7);
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}
/* Header uses the full page width so all menu items fit on one line */
.site-header .container { max-width: 100%; padding: 0 24px; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap; gap: 20px; }
.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}
.site-logo-img {
    height: 46px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.site-logo-text {
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.main-nav {
    overflow-x: auto;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.main-nav a {
    color: #dbe8ff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.10);
}
.main-nav a:hover { background: rgba(110, 160, 255, 0.22); color: #ffffff; border-color: rgba(255,90,82,0.5); }
.menu-toggle { display: none; background: rgba(255,255,255,0.12); border: none; color: #fff; font-size: 1.5rem; cursor: pointer; border-radius: 4px; padding: 2px 8px; }

/* Profile avatar menu (only shown when logged in) */
.user-menu { position: relative; list-style: none; }
.user-avatar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 90, 82, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 24px;
    padding: 3px 9px 3px 3px;
    cursor: pointer;
    color: #fff;
    font-size: 0.8rem;
}
.user-avatar:hover { background: rgba(255, 90, 82, 0.32); }
.avatar-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ed1c24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}
.avatar-caret { opacity: 0.85; }
.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 215px;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
    z-index: 200;
    overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-info {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.user-info strong { color: #1a3c5a; font-size: 0.95rem; }
.user-role { color: #777; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; }
.user-dropdown a {
    display: block;
    padding: 10px 14px;
    color: #1a3c5a;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: #fff;
    border: none;
}
.user-dropdown a:hover { background: #f0f4fa; color: #2e5cb8; text-decoration: none; }
.user-dropdown .logout-link { color: #ed1c24; border-top: 1px solid #eee; }

/* Main */
.site-main { padding: 30px 0; min-height: 60vh; }

/* Hero slider */
.hero-slider {
    position: relative;
    height: 340px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    background: #0a1730;
}
.hero-slider .slides { position: relative; width: 100%; height: 100%; }
.hero-slider .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
    display: flex;
    align-items: center;
}
.hero-slider .slide.active { opacity: 1; }
.slide-caption {
    width: 100%;
    padding: 0 60px;
    color: #fff;
    text-align: left;
    text-shadow: 0 2px 12px rgba(0,0,0,0.75);
}
.slide-caption h1, .slide-caption h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 2.4rem;
    border: none;
    padding: 0;
}
.slide-caption p { margin: 0; font-size: 1.15rem; max-width: 620px; }
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10,20,40,0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
}
.slider-arrow:hover { background: rgba(237,28,36,0.8); }
.slider-arrow.prev { left: 14px; }
.slider-arrow.next { right: 14px; }
.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 9px;
    z-index: 5;
}
.slider-dots button {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: transparent;
    cursor: pointer;
    padding: 0;
}
.slider-dots button.active { background: #ed1c24; border-color: #ed1c24; }

/* Sections */
section { margin-bottom: 40px; }
h2 { font-size: 1.5rem; margin-bottom: 20px; color: #1a3c5a; border-bottom: 2px solid #1a3c5a; padding-bottom: 10px; }
h3 { font-size: 1.25rem; margin-top: 0; color: #2a5d8a; }

/* Cards & grids */
.article-grid, .dict-grid, .weblink-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.card, .dict-card, .weblink-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}
.card h3, .dict-card h3, .weblink-card h3 { margin-top: 0; font-size: 1.2rem; }
.card p { color: #555; font-size: 0.95rem; margin: 10px 0; }
.lang-tag { display: inline-block; background: #e8f0f7; color: #1a3c5a; padding: 3px 8px; border-radius: 12px; font-size: 0.85rem; margin-right: 8px; }

/* Article list */
.article-list .list-item { padding: 15px 0; border-bottom: 1px solid #eee; }
.article-list .list-item h3 { margin: 0 0 5px; font-size: 1.1rem; }
.article-list .date { color: #777; font-size: 0.9rem; }

/* Single article */
.single-article { max-width: 800px; margin: 0 auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.article-header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.single-article h1 { font-size: 2rem; margin-bottom: 15px; }
.article-meta { display: flex; gap: 15px; color: #777; font-size: 0.9rem; }
.article-body { font-size: 1.05rem; line-height: 1.8; }
.article-body p { margin-bottom: 1.5em; }

/* Search */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.search-form select { padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.search-form button { padding: 10px 20px; background: #1a3c5a; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.search-form button:hover { background: #2a5d8a; }

.result-count { color: #555; margin-bottom: 20px; }
.result-list { margin-top: 10px; }
.result-item { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.result-item h3 { margin: 0 0 4px; font-size: 1.15rem; }
.result-meta { color: #888; font-size: 0.85rem; margin: 0 0 8px; }
.result-item p { color: #444; margin: 0; line-height: 1.6; }
mark { background: #ffe08a; color: #5c3b00; padding: 1px 2px; border-radius: 2px; font-weight: 600; }

/* Contact */
.contact-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.form-group textarea { resize: vertical; min-height: 100px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #1a3c5a;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn:hover { background: #2a5d8a; }
.btn-outline { background: transparent; border: 2px solid #1a3c5a; color: #1a3c5a; }
.btn-outline:hover { background: #1a3c5a; color: #fff; }

/* Forms & alerts */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
th { background: #f2f2f2; font-weight: 600; }

/* Admin */
.admin-login { max-width: 400px; margin: 50px auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.admin-login h2 { margin-top: 0; text-align: center; border: none; }
.admin-form .form-group { margin-bottom: 20px; }
.small { font-size: 0.85rem; color: #666; }

.admin-dashboard .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); text-align: center; }
.stat-card h3 { margin: 0 0 5px; font-size: 2rem; color: #1a3c5a; }
.stat-card p { margin: 0; color: #777; }
.admin-actions { margin-bottom: 30px; }
.admin-actions .btn { margin-right: 10px; margin-bottom: 10px; }

/* Footer */
.site-footer {
    background: #1a3c5a;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    margin-top: 40px;
}
.site-footer p { margin: 5px 0; opacity: 0.9; }
.footer-nav { margin-bottom: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.footer-nav a { color: #fff; text-decoration: none; font-size: 0.95rem; opacity: 0.9; }
.footer-nav a:hover { text-decoration: underline; opacity: 1; }

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .site-header .container { padding: 0 14px; }
    .header-inner { flex-wrap: wrap; }
    .main-nav { width: 100%; order: 3; overflow-x: visible; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        padding: 10px 0;
        background: rgba(6, 10, 20, 0.92);
        border-radius: 8px;
    }
    .main-nav ul.show { display: flex; }
    .main-nav a { display: block; padding: 10px; background: transparent; border: none; white-space: normal; }
    .hero-slider { height: 270px; }
    .slide-caption { padding: 0 28px; }
    .slide-caption h1, .slide-caption h2 { font-size: 1.6rem; }
    .slide-caption p { font-size: 0.95rem; }
    .slider-arrow { width: 34px; height: 34px; font-size: 1.4rem; }
    .article-grid, .dict-grid, .weblink-grid { grid-template-columns: 1fr; }
}

/* Admin styles */
.admin-section { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.admin-header h2 { margin: 0; border: none; padding: 0; }
.table-wrap { overflow-x: auto; margin-bottom: 30px; }
.admin-section table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.admin-section th, .admin-section td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #eee; }
.admin-section th { background: #f2f2f2; font-weight: 600; color: #1a3c5a; font-size: 0.9rem; text-transform: uppercase; }
.admin-section td { font-size: 0.95rem; }
.admin-section tr:hover { background: #f9f9f9; }
.actions { white-space: nowrap; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; margin: 0 3px; }
.article-excerpt {
    display: block;
    max-width: 320px;
    margin-top: 4px;
    color: #777;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-form { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.admin-form .form-group { margin-bottom: 20px; }
.admin-form .form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #1a3c5a; }
.admin-form .form-group input,
.admin-form .form-group select,
.admin-form .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.admin-form .form-group textarea { resize: vertical; min-height: 120px; }
.admin-form .required { color: #d32f2f; }
.admin-form .small { font-size: 0.85rem; color: #666; margin-top: 4px; display: block; }
.form-row { display: flex; gap: 20px; flex-wrap: wrap; }
.form-col { flex: 1; min-width: 250px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
.checkbox-label input { width: auto; }
.btn-primary { background: #1a3c5a; color: #fff; }
.btn-primary:hover { background: #2a5d8a; }

/* WYSIWYG editor */
.wysiwyg { border: 1px solid #ddd; border-radius: 4px; overflow: hidden; background: #fff; }
.wysi-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 6px; background: #f2f5f9; border-bottom: 1px solid #ddd; }
.wysi-btn { min-width: 30px; padding: 5px 9px; font-size: 0.85rem; border: 1px solid #d0d7e0; background: #fff; color: #1a3c5a; border-radius: 3px; cursor: pointer; }
.wysi-btn:hover { background: #e7eef7; border-color: #2e5cb8; }
.wysi-btn.active { background: #2e5cb8; color: #fff; }
.wysi-sep { width: 1px; height: 20px; background: #cfd8e3; margin: 0 4px; }
.wysi-editor { min-height: 260px; max-height: 520px; overflow-y: auto; padding: 16px 18px; outline: none; line-height: 1.7; font-size: 1rem; }
.wysi-editor:focus { box-shadow: inset 0 0 0 2px rgba(46,92,184,0.25); }
.wysi-editor h2 { border: none; padding: 0; color: #1a3c5a; margin: 0.6em 0 0.3em; }
.wysi-editor h3 { color: #2a5d8a; margin: 0.6em 0 0.3em; }
.wysi-editor ul, .wysi-editor ol { padding-left: 24px; }
.wysi-editor blockquote { border-left: 4px solid #2e5cb8; margin: 12px 0; padding: 6px 14px; background: #f5f8fc; color: #444; }
.wysi-editor pre { background: #f4f6f8; border: 1px solid #e2e6ea; padding: 10px; border-radius: 4px; white-space: pre-wrap; }
.wysi-editor img { max-width: 100%; height: auto; }
textarea.wysi-source { width: 100%; min-height: 260px; padding: 16px; border: 1px solid #ddd; border-radius: 4px; font-family: Consolas, Monaco, monospace; font-size: 0.9rem; }

/* Admin drive */
.drive-breadcrumb { margin-bottom: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.95rem; }
.drive-breadcrumb a { color: #2e5cb8; text-decoration: none; }
.drive-breadcrumb a:hover { text-decoration: underline; }
.drive-actions { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.drive-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drive-form input[type="text"] { padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; }
.drive-form input[type="file"] { max-width: 260px; font-size: 0.9rem; }
.drive-icon { margin-right: 4px; }
.drive-table .actions form { display: inline; margin: 0; }

/* Verb Group Finder */
.vgt-tool { max-width: 1100px; }
.vgt-intro { line-height: 1.7; color: #444; }
.vgt-links { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 20px; }
.vgt-links a { color: #2e5cb8; font-weight: 600; }
.vgt-form textarea, section.vgt-tool textarea {
    width: 100%;
    font-family: 'Nirmala UI', 'Mangal', Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.7;
}
.vgt-options { display: flex; gap: 32px; flex-wrap: wrap; margin: 16px 0; }
.vgt-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
code { background: #f2f5f9; padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }

/* Verb Group Finder — styled output */
.vgt-output {
    width: 100%;
    min-height: 200px;
    max-height: 420px;
    overflow: auto;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-family: 'Nirmala UI', 'Mangal', Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    color: #222;
}
.vgt-output .vgt-vg {
    font-weight: 700;
    color: #111;
}
.vgt-output .vgt-vg-inner {
    background: #fff6e0;
    border-radius: 3px;
    padding: 1px 2px;
}
.vgt-output .vgt-pos-tag {
    color: #8b0f14;
    font-weight: 500;
}
.vgt-output .vgt-vg-label {
    color: #8b0f14;
    font-weight: 700;
    background: #fde8e8;
    padding: 1px 4px;
    border-radius: 3px;
}
.vgt-output .vgt-vg-unknown {
    color: #a85314;
    font-weight: 700;
}
.vgt-output .vgt-warning {
    background: #fff3cd;
    color: #7a5200;
    border: 1px solid #ffd97d;
    border-radius: 3px;
    padding: 2px 5px;
    font-family: sans-serif;
    font-size: 0.85rem;
}

/* Contact page */
.contact-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(320px, 2fr); gap: 40px; align-items: start; }
.contact-details { background: #f7f9fc; border: 1px solid #e0e6ee; border-radius: 8px; padding: 24px; }
.contact-details h3 { margin-top: 0; }
.contact-details p { line-height: 1.8; }
.contact-details code { background: #e8eef7; color: #8b0f14; }
.contact-form-wrap { min-width: 0; }
.contact-note { background: #f7f9fc; border: 1px solid #e0e6ee; border-radius: 8px; padding: 24px; }
.contact-note h3 { margin-top: 0; }
.contact-note p { line-height: 1.8; }
.contact-grid .form-group input,
.contact-grid .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; gap: 24px; } }