/* EU-Verordnungen Monitor - Stylesheet */

:root {
    --eu-blue: #1140a0;
    --eu-blue-dark: #0d3280;
    --eu-gold: #FFCC00;
    --bg-primary: #f5f6f8;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Update Banner */
.update-banner {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: block;
}

.update-banner .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.update-banner.update-success { background: #10b981; color: #fff; }
.update-banner.update-info { background: #3b82f6; color: #fff; }
.update-icon { display: inline-flex; align-items: center; }
.update-icon svg { width: 20px; height: 20px; }
.update-time { opacity: 0.85; font-size: 12px; }

/* Header */
.header {
    background: linear-gradient(135deg, rgba(17, 64, 160, 0.80) 0%, rgba(13, 50, 128, 0.85) 100%),
                url('bilder/EU-Verodnungsmonitor.webp');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 1.5rem 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.eu-flag {
    display: flex;
    align-items: center;
    justify-content: center;
}

.eu-flag img {
    border: 1px solid white;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.header-source {
    font-weight: 400;
}

.header-source a {
    color: white;
    text-decoration: none;
}

.header-info { font-size: 0.875rem; }

.last-update {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border: 2px solid white;
    border-radius: var(--border-radius);
}

/* Intro Section */
.intro-section { margin: 2rem 0; }

.intro-card {
    background: #c3daf4;
    color: var(--text-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 2px solid #1140a0;
    text-align: center;
}

.intro-card h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
}

.regulations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
    text-align: left;
}

.regulation-item {
    background: rgba(255,255,255,0.12);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    border-left: 3px solid rgba(255,204,0,0.8);
}

.regulation-item strong { color: #ffd700; }

/* Dashboard */
.dashboard { margin: 2rem 0; }

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--eu-blue);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Filter Section */
.filter-section { margin: 2rem 0; }

.filter-bar {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-search { flex: 1; min-width: 200px; }
.filter-search input { width: 100%; }

/* Actions */
.actions-section { margin: 2rem 0; }

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.actions-bar h2 {
    font-size: 1.25rem;
    margin: 0;
}

.actions-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn .icon { width: 16px; height: 16px; }

.btn-primary {
    background: var(--eu-blue);
    color: white;
}
.btn-primary:hover { background: var(--eu-blue-dark); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-primary); }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Documents */
.documents-section { margin: 2rem 0; }

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.document-card:hover { box-shadow: var(--shadow-md); }
.document-card.hidden { display: none; }

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.document-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.document-date .icon { width: 14px; height: 14px; }

.document-type {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.document-type-verordnung { background: #dbeafe; color: #1e40af; }
.document-type-berichtigung { background: #fef3c7; color: #92400e; }
.document-type-konsolidierte-fassung { background: #e0f2fe; color: #0369a1; }
.document-type-durchfuehrungsakt { background: #f3e8ff; color: #7c3aed; }
.document-type-delegierter-rechtsakt { background: #e0e7ff; color: #4338ca; }
.document-type-mitteilung { background: #dcfce7; color: #166534; }
.document-type-sonstiges { background: #f3f4f6; color: #4b5563; }

.document-regulation {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--eu-blue);
    color: white;
}

.document-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.document-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.document-info a {
    color: var(--eu-blue);
    text-decoration: none;
}
.document-info a:hover { text-decoration: underline; }

.document-summary {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.document-summary h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
}

.document-summary p {
    margin: 0;
    font-size: 0.9rem;
}

.document-corrections {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: var(--border-radius);
}

.document-corrections h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    margin: 0 0 0.5rem 0;
}

.document-corrections ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: #78350f;
}

.document-corrections li { margin-bottom: 0.25rem; }

.document-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.no-documents {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* History Timeline */
.history-timeline {
    position: relative;
    padding-left: 2rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.history-item {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.history-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    background: var(--bg-card);
    border: 2px solid var(--eu-blue);
    border-radius: 50%;
}

.history-item.is-original::before {
    background: #10b981;
    border-color: #10b981;
}

.history-item.is-latest::before {
    background: var(--eu-blue);
    border-color: var(--eu-blue);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.history-date {
    font-weight: 600;
    color: var(--text-primary);
}

.history-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.history-badge.badge-original {
    background: #dcfce7;
    color: #166534;
}

.history-badge.badge-latest {
    background: #dbeafe;
    color: #1e40af;
}

.history-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--eu-blue);
}

.history-celex {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.history-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: 4px;
}

.history-summary-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.history-link {
    font-size: 0.8rem;
}

.history-link a {
    color: var(--eu-blue);
    text-decoration: none;
}

.history-link a:hover { text-decoration: underline; }

/* Compact Intro */
.intro-card-compact {
    padding: 1.5rem 2rem;
}

.intro-card-compact h2 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    color: #1140a0;
}

.intro-lead {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Benefits Section */
.benefits-section {
    margin: 1.5rem 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.benefit-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    z-index: 0;
}

.benefit-card:nth-child(1)::before {
    background-image: url('bilder/zeitersparnis.png');
    opacity: 0.08; /* Zeitersparnis */
}

.benefit-card:nth-child(2)::before {
    background-image: url('bilder/uebersichtlichkeit.png');
    opacity: 0.20; /* Übersichtlichkeit */
}

.benefit-card:nth-child(3)::before {
    background-image: url('bilder/nachvollziehbarkeit.png');
    opacity: 0.10; /* Nachvollziehbarkeit */
}

.benefit-card > * {
    position: relative;
    z-index: 1;
}

.benefit-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, var(--eu-blue) 0%, var(--eu-blue-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.benefit-card h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.benefit-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Regulations Filter Chips */
.regulations-filter-section {
    margin: 1.5rem 0 2rem;
}

.regulations-filter-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regulations-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.regulation-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.regulation-chip:hover {
    border-color: var(--eu-blue);
    background: #f0f4ff;
}

.regulation-chip.active {
    background: var(--eu-blue);
    border-color: var(--eu-blue);
    color: white;
}

.regulation-chip.active .chip-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.chip-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background: var(--eu-blue);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification-success { background: #10b981; color: white; }
.notification-error { background: #ef4444; color: white; }
.notification-info { background: #3b82f6; color: white; }

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
}

.notification-close:hover { opacity: 1; }

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Section Divider */
.section-divider {
    margin: 3rem 0 2rem;
    text-align: center;
}

.divider-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* FAQ Section */
.faq-section {
    margin: 2rem 0 2rem;
}

.faq-section h2 {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--eu-blue);
    transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
    content: '−';
}

.faq-question:hover {
    background: var(--bg-primary);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.faq-answer p {
    margin: 0 0 0.75rem 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, rgba(17, 64, 160, 0.95) 0%, rgba(13, 50, 128, 1) 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer-brand {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.footer-note {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 0 0 1rem 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
    .filter-bar { flex-direction: column; }
    .filter-group { width: 100%; }
    .filter-group select,
    .filter-group input { width: 100%; }
    .document-actions { flex-direction: column; }
    .document-actions .btn { width: 100%; justify-content: center; }
}
