/* /assets/style.css */

/* 1. DESIGN TOKENS & SYSTEM FONTS (100% DSGVO-KONFORM) */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --primary: #2d3748;
    --primary-hover: #1a202c;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --radius: 12px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

/* Button Pfeile */
button span{
    margin-right: 5px;
}

/* 2. LAYOUT GERÜST (SIDEBAR + MAIN CONTENT) */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px TYPE_BORDER var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
    max-width: 1100px;
}

/* 3. KARTEN-DESIGN (WIE IN DEN SCREENSHOTS) */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 4. BUTTONS & FORMULAR-ELEMENTE */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-family: var(--font-stack);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

input:focus, textarea:focus {
    border-color: var(--primary);
}

/* ERWEITERUNG FÜR SPLIT-SCREEN & LOGIN (index.php) */

.split-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Linke Seite mit atmosphärischem Hintergrund */
.left-side {
    flex: 1;
    background: linear-gradient(rgba(46, 56, 77, 0.8), rgba(46, 56, 77, 0.9)), 
                url('../hintergrund-index.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #ffffff;
}

@media (max-width: 768px) {
    .left-side { display: none; } /* Auf Smartphones ausblenden wie im modernen UI-Design */
}

.brand-overlay {
    text-align: center;
    max-width: 500px;
}

.heart-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.brand-overlay h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.brand-overlay p {
    font-size: 16px;
    opacity: 0.85;
    line-height: 1.6;
}

/* Rechte Seite mit den Formularen */
.right-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    padding: 40px;
}

.auth-wrapper {
    width: 100%;
    max-width: 400px;
}

/* Tab Navigation oben */
.tab-navigation {
    display: flex;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 32px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    font-family: var(--font-stack);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Tab Inhalte ein- und ausblenden */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 700;
}

.tab-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Formular Feinschliff */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-link {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 24px;
}

.form-link:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    padding: 14px;
}

.alert-message {
    background-color: var(--danger-bg);
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid #fca5a5;
}

/* EXTENSION: SIDEBAR, TOPBAR & MAIN DASHBOARD GRAPHICS */

/* Sidebar Profile Block */
.sidebar-profile {
    padding: 0 24px 24px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background-color: #e2e8f0;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.profile-info h3 {
    font-size: 14px;
    font-weight: 600;
}

.profile-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Sidebar Nav Links */
.sidebar-nav {
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background-color: #f1f5f9;
    color: var(--primary);
}

.nav-item.active {
    background-color: #e2e8f0;
    font-weight: 600;
}

.sidebar-footer {
    padding: 0 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.logout-link:hover {
    background-color: var(--danger-bg);
    color: var(--danger);
}

/* Content Header & Topbar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.welcome-text {
    font-size: 14px;
    color: var(--text-muted);
}

.btn-outline-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline-logout:hover {
    background: #f1f5f9;
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

/* Cards & Elements Inner Layout */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Simulierter Rich-Text Textarea */
.editor-toolbar {
    display: flex;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 8px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.tool-btn {
    padding: 4px 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.tool-btn:hover { background: #f1f5f9; }

.editor-textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    min-height: 180px;
    resize: vertical;
}

.standard-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Elegante Data-Tables (CRUD) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
}

.text-right { text-align: right; }
.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 4px;
}
.action-btn:hover { background-color: #f1f5f9; }

/* Dashboard Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

/* RESPONSIVE UPDATES FÜR DAS DASHBOARD */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column; /* Stapelt Sidebar und Inhalt untereinander */
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-profile {
        padding-bottom: 12px;
    }

    .sidebar-nav {
        flex-direction: row; /* Navigationspunkte nebeneinander auf dem Handy */
        overflow-x: auto;   /* Scrollbar, falls es zu viele Menüpunkte werden */
        padding: 12px 0 0 0;
    }

    .main-content {
        margin-left: 0; /* Entfernt den Desktop-Abstand */
        padding: 20px;
    }

    .card {
        padding: 20px; /* Mehr Platz auf kleinen Bildschirmen */
    }

    .card-header {
        flex-direction: column; /* Button wandert unter die Überschrift */
        gap: 12px;
    }

    .card-header .btn {
        width: 100%; /* Button über die volle Breite auf dem Handy */
    }

    /* Tabellen-Retter für Smartphones */
    .data-table thead {
        display: none; /* Versteckt die Tabellen-Überschriften */
    }

    .data-table, .data-table tbody, .data-table tr, .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 8px;
        background: #f8fafc;
    }

    .data-table td {
        text-align: left;
        border-bottom: none;
        padding: 6px 12px;
    }

    .data-table td.text-right {
        text-align: right;
        border-top: 1px solid var(--border-color);
        margin-top: 8px;
        padding-top: 12px;
    }
}

/* MODAL OVERLAY (DUNKLER HINTERGRUND) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6); /* Modernes, softes Slate-Transparenz-Grau */
    backdrop-filter: blur(4px);        /* Schicker Unschärfe-Effekt für den Hintergrund */
    display: none;                     /* Standardmäßig unsichtbar */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

/* THE MODAL BOX */
.modal-box {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}
.close-modal-btn:hover { color: var(--text-main); }

.security-notice {
    font-size: 12px;
    color: #b45309; /* Edler Bernstein-Farbton für Warnhinweise */
    background: #fef3c7;
    padding: 10px 12px;
    border-radius: 6px;
    margin: 16px 0;
    font-weight: 500;
}

/* Animation beim Öffnen */
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Feinschliff für Modals */
@media (max-width: 480px) {
    .modal-box {
        padding: 20px;
    }
}

/* ALARMBANNER FÜR MISSBRAUCHSSCHUTZ */
.emergency-warning-banner {
    background-color: var(--danger-bg);
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}

.warning-text strong {
    color: #991b1b;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.warning-text p {
    color: #7f1d1d;
    font-size: 14px;
}

.emergency-warning-banner .btn-danger {
    background-color: var(--danger);
    color: white;
    white-space: nowrap;
}

.emergency-warning-banner .btn-danger:hover {
    background-color: #b91c1c;
}

.info-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Responsive Anpassung für das Banner */
@media (max-width: 768px) {
    .emergency-warning-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

.alert-message.success-message {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* EXTENSION: EMERGENCY VIEWS & LETTER DESIGN */

.emergency-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
}

.emergency-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.emergency-page-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.emergency-page-header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 650px;
    margin: 0 auto;
}

/* Countdown Card Style (image_11.png) */
.countdown-card {
    text-align: center;
    padding: 40px;
    background: #f1f5f9;
}

.clock-icon, .check-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 12px;
}

.countdown-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 24px;
}

.countdown-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.time-box {
    background: white;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    min-width: 90px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.time-box span {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.time-box label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

/* Success Unlock View (image_12.png) */
.success-unlock-card {
    text-align: center;
    padding: 40px;
}

.success-unlock-card h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.success-unlock-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

/* THE BRIEFBOGEN-DESIGN (image_7.png / image_9.png) */
.document-actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.letter-sheet {
    background: #ffffff;
    padding: 60px 50px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    font-family: Georgia, Cambria, "Times New Roman", Times, serif; /* Hochwertiger Serif-Fluss */
    color: #111827;
}

.letter-date {
    text-align: right;
    font-size: 14px;
    color: var(--text-muted);
    font-family: var(--font-stack);
}

.letter-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.letter-header h2 {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-family: var(--font-stack);
    margin-bottom: 16px;
}

.letter-intro {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.letter-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

.letter-section {
    margin-bottom: 36px;
}

.letter-section h3 {
    font-family: var(--font-stack);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.letter-text-content {
    font-size: 16px;
    line-height: 1.6;
}

.letter-appendix-title {
    text-align: center;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-family: var(--font-stack);
    font-weight: 600;
}

/* Appendix Items (image_7.png Style) */
.appendix-item-box {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
    font-family: var(--font-stack);
}

.item-badge {
    display: inline-block;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    float: right;
}

.appendix-item-box label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.appendix-item-box p {
    font-size: 14px;
    color: var(--text-main);
}

.item-row-triple, .item-row-double {
    display: grid;
    gap: 16px;
    margin-top: 12px;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

.item-row-triple { grid-template-columns: repeat(3, 1fr); }
.item-row-double { grid-template-columns: repeat(2, 1fr); }

.static-text-box {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.letter-footer {
    text-align: center;
    margin-top: 60px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-stack);
}

/* DEVELOPER OVERLAY STYLING */
.developer-time-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fef08a;
    border-bottom: 1px solid #eab308;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-family: var(--font-stack);
    z-index: 99999;
}

/* SMART NATIVE PRINT CONTROL TO GENERATE PERFECT EXPORTS */
@media print {
    body { background: white; }
    .developer-time-box, .document-actions-bar, .emergency-page-header { display: none !important; }
    .emergency-container { max-width: 100%; padding: 0; margin: 0; }
    .letter-sheet { border: none; box-shadow: none; padding: 0; margin: 0; }
}

@media (max-width: 600px) {
    .item-row-triple, .item-row-double { grid-template-columns: 1fr; }
    .countdown-grid { flex-wrap: wrap; }
    .letter-sheet { padding: 30px 20px; }
}