/* ============================================
   JusEvidence v1.0 - Stylesheet
   Farbschema: Dunkelblau (#0d2137) + Gold (#c9a227)
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    background: #0d2137;
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-badge {
    background: #c9a227;
    color: #0d2137;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.lang-select {
    padding: 8px 12px;
    border: 1px solid #1e3a5f;
    border-radius: 6px;
    background: #1e3a5f;
    color: white;
    cursor: pointer;
}

#userMenu {
    display: flex;
    align-items: center;
    gap: 12px;
}

#userName {
    color: #cbd5e1;
    font-weight: 500;
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    background: #c9a227;
    color: #0d2137;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #b08620;
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #0d2137;
    border: 1px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #c9a227;
    color: #b08620;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

.btn-icon-only {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
}

.btn-icon-only:hover {
    opacity: 1;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: #16a34a;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-success:hover {
    background: #15803d;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    background: linear-gradient(135deg, #0d2137 0%, #1e3a5f 100%);
    color: white;
    padding: 80px 24px;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 16px;
    font-weight: 700;
}

.hero p {
    font-size: 18px;
    color: #cbd5e1;
    margin-bottom: 32px;
}

/* ============================================
   About Section
   ============================================ */
.about-section {
    padding: 60px 24px;
    background: white;
}

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

.about-section h2 {
    font-size: 28px;
    color: #0d2137;
    margin-bottom: 16px;
    text-align: center;
}

.about-section > .container > p {
    text-align: center;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* ============================================
   Feature Grid
   ============================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.feature-card.highlight {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #c9a227;
}

.feature-card h3 {
    color: #0d2137;
    font-size: 16px;
    margin-bottom: 8px;
}

.feature-card p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* Badge New */
.badge-new {
    background: #c9a227;
    color: #0d2137;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================
   Comparison Section
   ============================================ */
.comparison-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
}

.comparison-section h3 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 12px;
    color: #0d2137;
}

.comparison-section > p {
    text-align: center;
    color: #64748b;
    margin-bottom: 24px;
}

.comparison-table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #0d2137;
}

.comparison-table .check {
    color: #16a34a;
    font-weight: bold;
}

.comparison-table .cross {
    color: #dc2626;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    padding: 40px 24px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   Search Section
   ============================================ */
.search-section {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.search-header {
    text-align: center;
    margin-bottom: 32px;
}

.search-header h1 {
    font-size: 26px;
    margin-bottom: 8px;
    color: #0d2137;
}

.search-header p {
    color: #64748b;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
}

.search-box input:focus {
    outline: none;
    border-color: #c9a227;
}

.search-options {
    display: flex;
    justify-content: center;
    gap: 24px;
    color: #64748b;
    font-size: 14px;
}

.search-options label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-options select {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.verification-box {
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
/* ==================================================
  Verification
   ================================================== */
.verification-box h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #1e3a5f;
}

.verification-stats {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.verification-stats .verified { color: #059669; }
.verification-stats .not-found { color: #dc2626; }
.verification-stats .unverified { color: #d97706; }

.verification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.verification-list li {
    padding: 4px 0;
}

.verification-list li.verified { color: #059669; }
.verification-list li.not_found { color: #dc2626; }
.verification-list li.unverified { color: #d97706; }

/* ============================================
   Results Section
   ============================================ */
.results-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.results-header h2 {
    font-size: 20px;
    margin-bottom: 4px;
    color: #0d2137;
}

.results-header p {
    color: #64748b;
    font-size: 14px;
}

/* ============================================
   AI Controls
   ============================================ */
.ai-controls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ai-header h3 {
    font-size: 16px;
    color: #0d2137;
}

.summary-lang-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ai-hint {
    margin-top: 12px;
    color: #64748b;
    font-size: 13px;
}

/* ============================================
   AI Summary Box
   ============================================ */
.ai-summary-box {
    background: #f8fafc;
    border: 1px solid #c9a227;
    border-radius: 6px;
    margin-bottom: 24px;
}

.summary-header {
    background: #0d2137;
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-header .btn-icon-only {
    color: white;
}

.summary-content {
    padding: 24px;
    line-height: 1.7;
    font-size: 14px;
}

.summary-content h1, .summary-content h2, .summary-content h3 {
    margin: 20px 0 10px;
    color: #0d2137;
}

.summary-content p {
    margin-bottom: 12px;
}

.summary-content ul, .summary-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

/* ============================================
   Articles/Documents List
   ============================================ */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 18px;
    transition: all 0.2s;
}

.article-card:hover {
    border-color: #94a3b8;
}

.article-card.excluded {
    opacity: 0.5;
    background: #fef2f2;
    border-color: #fca5a5;
}

.article-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.article-title {
    font-weight: 600;
    color: #0d2137;
    font-size: 15px;
    line-height: 1.4;
}

.article-title a {
    color: inherit;
    text-decoration: none;
}

.article-title a:hover {
    color: #c9a227;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.article-abstract {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.article-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Document Type Badge */
.doc-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}

.doc-type-badge.gesetz {
    background: #dbeafe;
    color: #1e40af;
}

.doc-type-badge.urteil {
    background: #fef3c7;
    color: #92400e;
}

.doc-type-badge.verordnung {
    background: #dcfce7;
    color: #166534;
}

/* ============================================
   Assisted Search Box
   ============================================ */
.assisted-search-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #c9a227;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.assisted-search-box h3 {
    color: #0d2137;
    margin-bottom: 12px;
    font-size: 16px;
}

.assisted-search-box textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.assisted-search-box textarea:focus {
    outline: none;
    border-color: #c9a227;
}

.translation-result {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.translation-result h4 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.translation-terms {
    font-size: 16px;
    font-weight: 600;
    color: #0d2137;
}

/* ============================================
   Save Controls
   ============================================ */
.save-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.save-controls input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
}

/* ============================================
   Usage Limits
   ============================================ */
.usage-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.usage-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: #c9a227;
    border-radius: 3px;
    transition: width 0.3s;
}

.usage-fill.warning {
    background: #f59e0b;
}

.usage-fill.danger {
    background: #dc2626;
}

/* ============================================
   Modals
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 600px;
}

.modal-content h2 {
    background: #0d2137;
    color: white;
    padding: 18px 24px;
    font-size: 18px;
    margin: 0;
}

.close-btn {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
}

.close-btn:hover {
    color: #0d2137;
}

.modal-content form {
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #0d2137;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #c9a227;
}

.modal-footer {
    text-align: center;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
}

.modal-footer a {
    color: #c9a227;
    text-decoration: none;
    font-weight: 500;
}

.modal-footer a:hover {
    color: #b08620;
}

.modal-note {
    padding: 14px 24px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    text-align: center;
}

/* ============================================
   Disclaimer
   ============================================ */
.disclaimer-section {
    padding: 16px 24px;
}

.disclaimer-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #0d2137;
}

.disclaimer-section p {
    color: #475569;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 12px;
}

.disclaimer-section.warning {
    background: #fef3c7;
    border-left: 4px solid #c9a227;
    margin: 0;
}

.disclaimer-section.warning p {
    color: #92400e;
    font-weight: 500;
    margin: 0;
}

.consent-section {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

.consent-section + .btn-primary {
    margin: 0 24px 24px;
    width: calc(100% - 48px);
}

/* ============================================
   Pending Content
   ============================================ */
.pending-icon, .verify-icon {
    font-size: 48px;
    text-align: center;
    padding: 24px;
    color: #c9a227;
}

.modal-content > p {
    padding: 0 24px 12px;
    color: #475569;
    line-height: 1.7;
    text-align: center;
}

.modal-content > .btn-secondary {
    margin: 12px 24px 24px;
    width: calc(100% - 48px);
}

/* ============================================
   Checkbox
   ============================================ */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #c9a227;
}

/* ============================================
   Admin Styles
   ============================================ */
.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 24px;
}

.admin-login-box {
    background: white;
    border-radius: 8px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-login-box h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #0d2137;
}

.admin-header {
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #0d2137;
}

.admin-header p {
    color: #64748b;
}

.admin-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #0d2137;
}

/* Toggle Switch */
.settings-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle-label span {
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #c9a227;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.setting-description {
    font-size: 13px;
    color: #64748b;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.admin-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.admin-tab:hover {
    color: #c9a227;
}

.admin-tab.active {
    color: #c9a227;
    border-bottom-color: #c9a227;
}

.badge {
    background: #dc2626;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #0d2137;
}

.admin-table tr:hover {
    background: #f8fafc;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-unverified {
    background: #fee2e2;
    color: #991b1b;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #0d2137;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: #0d2137;
    color: #94a3b8;
    padding: 20px 24px;
    margin-top: auto;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    font-weight: 600;
    color: white;
    margin-bottom: 6px;
}

.footer-disclaimer {
    font-size: 12px;
    line-height: 1.6;
}

.footer-disclaimer a {
    color: #c9a227;
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0d2137;
    color: white;
    padding: 14px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    font-size: 14px;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #c9a227;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        padding: 50px 24px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .ai-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .save-controls {
        flex-direction: column;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .modal-content {
        margin: 10px;
    }
}
