/**
 * legal-modal.css
 * Styling für das Legal Modal System
 * VERSION: 1.0.0
 */

/* ============================================================================
   MODAL CONTAINER & OVERLAY
   ============================================================================ */

.legal-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.legal-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ============================================================================
   MODAL CONTAINER
   ============================================================================ */

.legal-modal-container {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================================
   MODAL HEADER
   ============================================================================ */

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.legal-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.legal-modal-close:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.legal-modal-close:active {
    transform: scale(0.95);
}

/* ============================================================================
   MODAL BODY
   ============================================================================ */

.legal-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    position: relative;
}

/* Custom Scrollbar */
.legal-modal-body::-webkit-scrollbar {
    width: 8px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================================================
   MODAL CONTENT
   ============================================================================ */

.legal-modal-content {
    color: #374151;
    line-height: 1.7;
}

.legal-modal-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.legal-modal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-modal-content p {
    margin-bottom: 1rem;
}

.legal-modal-content ul,
.legal-modal-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.legal-modal-content li {
    margin-bottom: 0.5rem;
}

.legal-modal-content a {
    color: #1e40af;
    text-decoration: underline;
}

.legal-modal-content a:hover {
    color: #1e3a8a;
}

.legal-modal-content strong {
    font-weight: 600;
    color: #111827;
}

.legal-modal-content code {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
}

.legal-modal-content pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.legal-modal-content blockquote {
    border-left: 4px solid #1e40af;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

.legal-modal-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.legal-modal-content th,
.legal-modal-content td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.legal-modal-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.legal-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1.5rem;
}

.legal-modal-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.legal-modal-loading p {
    margin: 0;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
}

/* ============================================================================
   ERROR STATE
   ============================================================================ */

.legal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    gap: 1rem;
}

.legal-error svg {
    color: #ef4444;
}

.legal-error h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.legal-error p {
    margin: 0;
    color: #6b7280;
    max-width: 400px;
}

/* ============================================================================
   MODAL FOOTER
   ============================================================================ */

.legal-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

.legal-modal-footer .btn {
    min-width: 120px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .legal-modal {
        padding: 0;
        align-items: stretch;
    }
    
    .legal-modal-container {
        max-height: 100vh;
        border-radius: 0;
        height: 100%;
    }
    
    .legal-modal-header,
    .legal-modal-body,
    .legal-modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .legal-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .legal-modal-content h1 {
        font-size: 1.5rem;
    }
    
    .legal-modal-content h2 {
        font-size: 1.25rem;
    }
    
    .legal-modal-content h3 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .legal-modal-header {
        padding: 1rem;
    }
    
    .legal-modal-body {
        padding: 1rem;
    }
    
    .legal-modal-footer {
        padding: 1rem;
    }
    
    .legal-modal-footer .btn {
        width: 100%;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .legal-modal-overlay,
    .legal-modal-header,
    .legal-modal-footer {
        display: none;
    }
    
    .legal-modal-container {
        box-shadow: none;
        border: none;
        max-height: none;
    }
    
    .legal-modal-body {
        overflow: visible;
        padding: 0;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus styles für Tastaturnavigation */
.legal-modal-close:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

.legal-modal-footer .btn:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

/* Reduced motion für Nutzer mit Bewegungsempfindlichkeit */
@media (prefers-reduced-motion: reduce) {
    .legal-modal,
    .legal-modal-container,
    .legal-modal-loading .spinner {
        animation: none;
    }
    
    * {
        transition: none !important;
    }
}