/**
 * Chat Renderer Styles
 * Richtext-Antworten, Collapsible Sources, Mini-Charts
 */

/* ============================================
   ANSWER SECTION
   ============================================ */

.answer-richtext {
    font-size: 1rem;
    line-height: 1.7;
    color: #1a1a2e;
}

.answer-richtext h1 {
    font-size: 1.6rem;
    color: #16213e;
    margin: 1rem 0 0.5rem;
    border-bottom: 2px solid #e94560;
    padding-bottom: 0.3rem;
}

.answer-richtext h2 {
    font-size: 1.35rem;
    color: #1a1a2e;
    margin: 1rem 0 0.5rem;
}

.answer-richtext h3 {
    font-size: 1.15rem;
    color: #0f3460;
    margin: 0.8rem 0 0.4rem;
}

.answer-richtext h4 {
    font-size: 1rem;
    color: #16213e;
    margin: 0.6rem 0 0.3rem;
}

.answer-richtext ul,
.answer-richtext ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
    padding: 0;
}

.answer-richtext li {
    margin-bottom: 0.4rem;
}

.answer-richtext table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.answer-richtext table th,
.answer-richtext table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.answer-richtext table th {
    background: #f8f9fa;
    color: #16213e;
    font-weight: 600;
}

.answer-richtext table tr:last-child td {
    border-bottom: none;
}

.answer-richtext table tr:hover {
    background: #f8f9fa;
}

.answer-richtext a {
    color: #e94560;
    text-decoration: none;
}

.answer-richtext a:hover {
    text-decoration: underline;
}

.answer-richtext details {
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.answer-richtext details summary {
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
}

.answer-richtext details[open] summary {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
}

.no-answer {
    color: #666;
    font-style: italic;
}

/* ============================================
   METADATA BAR
   ============================================ */

.metadata-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.meta-item {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: help;
}

.meta-item:hover {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   LLM INFO MODAL (Hover)
   ============================================ */

.llm-info-trigger {
    position: relative;
    cursor: pointer;
}

.llm-info-trigger.llm-active {
    background: rgba(76, 175, 80, 0.3);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.llm-info-trigger.llm-fallback {
    background: rgba(255, 152, 0, 0.3);
    border: 1px solid rgba(255, 152, 0, 0.5);
}

.llm-info-modal {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    min-width: 350px;
    max-width: 450px;
    background: #1a1a2e;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 1000;
    text-align: left;
    font-size: 0.85rem;
}

.llm-info-trigger:hover .llm-info-modal {
    display: block;
}

.llm-modal-header {
    font-weight: 700;
    font-size: 1rem;
    color: #4caf50;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.llm-modal-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.llm-label {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.llm-value {
    color: #fff;
    font-weight: 500;
    word-break: break-word;
}

.llm-keywords {
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Mobile: Modal links ausrichten */
@media (max-width: 768px) {
    .llm-info-modal {
        right: auto;
        left: 0;
        min-width: 280px;
    }
}

/* ============================================
   STATS SECTION
   ============================================ */

.stats-details {
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.stats-details summary {
    padding: 0.8rem 1rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

.stats-details[open] summary {
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
    padding: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-size: 0.85rem;
    white-space: nowrap;  /* Verhindert vertikalen Textumbruch */
    min-width: 0;
}

.stat-item span {
    font-size: 1.2rem;
    flex-shrink: 0;  /* Emoji nicht schrumpfen */
}

/* ============================================
   SOURCES CONTAINER
   ============================================ */

.sources-container {
    margin-top: 1.5rem;
}

.sources-container h4 {
    color: #16213e;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.no-sources {
    color: #666;
    font-style: italic;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ============================================
   SOURCE DETAIL (Collapsible)
   ============================================ */

.source-detail {
    margin-bottom: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s;
    border-left: 4px solid #ccc;  /* Default grau */
}

.source-detail:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ========================================
   STATUS-FARBEN für Quellen
   ======================================== */
.source-detail.status-open {
    background: #c8e6c9 !important;  /* Hellgrün */
    border-left: 5px solid #2e7d32 !important;
}

.source-detail.status-archived {
    background: #fff9c4 !important;  /* Hellgelb */
    border-left: 5px solid #f9a825 !important;
}

.source-detail.status-deleted {
    background: #ffcdd2 !important;  /* Hellrot */
    border-left: 5px solid #c62828 !important;
}

.source-detail.status-spam {
    background: #e1bee7 !important;  /* Helllila */
    border-left: 5px solid #7b1fa2 !important;
}

.source-detail.status-unknown {
    border-left-color: #9e9e9e;  /* Grau */
}

/* ========================================
   STATUS-LEGENDE
   ======================================== */
.sources-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.legend-open { background: #e8f5e9; color: #2e7d32; }
.legend-archived { background: #fffde7; color: #f57f17; }
.legend-spam { background: #f3e5f5; color: #7b1fa2; }
.legend-deleted { background: #ffebee; color: #c62828; }

/* ========================================
   STATUS OVERVIEW (am Anfang der Antwort)
   ======================================== */
.status-overview {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.status-badges-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.status-badge-overview {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-open { background: #e8f5e9; color: #2e7d32; }
.badge-archived { background: #fffde7; color: #f57f17; }
.badge-deleted { background: #ffebee; color: #c62828; }
.badge-spam { background: #f3e5f5; color: #7b1fa2; }

.status-alert-box {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-left: 4px solid #f44336;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.status-overview.status-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left-color: #ff9800;
}

.status-alert {
    font-weight: 600;
    color: #e65100;
}

/* Mobile Anpassungen */
@media (max-width: 480px) {
    .status-overview {
        padding: 0.6rem 0.8rem;
    }
    
    .status-badges-row {
        font-size: 0.8rem;
    }
    
    .status-badge-overview {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .status-alert-box {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}
}

.source-summary {
    padding: 0.8rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: #fafafa;
    font-size: 0.95rem;
}

.source-summary:hover {
    background: #f0f0f0;
}

.source-summary strong {
    color: #1a1a2e;
}

.source-meta {
    color: #666;
    font-size: 0.85rem;
}

.source-detail[open] .source-summary {
    border-bottom: 1px solid #e0e0e0;
}

.source-content {
    padding: 1rem;
}

/* Score Badges */
.score-high {
    color: #4caf50;
}

.score-mid {
    color: #ff9800;
}

.att-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: auto;
}

/* ============================================
   SOURCE TABLE
   ============================================ */

.source-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.source-table th {
    text-align: left;
    color: #666;
    font-weight: 500;
    padding: 0.4rem 0.6rem 0.4rem 0;
    width: 100px;
    vertical-align: top;
}

.source-table td {
    padding: 0.4rem 0;
    color: #1a1a2e;
}

.source-table .muted {
    color: #999;
    font-size: 0.8rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-open {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-archived {
    background: #f5f5f5;
    color: #757575;
}

.status-deleted {
    background: #ffebee;
    color: #c62828;
}

.status-unknown {
    background: #f5f5f5;
    color: #9e9e9e;
}

/* Tag Badges */
.tag-badge {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

/* ============================================
   ATTACHMENTS
   ============================================ */

.source-attachments {
    margin: 0.8rem 0;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.source-attachments strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #16213e;
}

.attachments-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.attachment-item:last-child {
    border-bottom: none;
}

.att-icon {
    font-size: 1.1rem;
}

.att-link {
    color: #1976d2;
    text-decoration: none;
    flex: 1;
}

.att-link:hover {
    text-decoration: underline;
    color: #e94560;
}

.att-meta {
    color: #999;
    font-size: 0.75rem;
}

/* ============================================
   BODY DETAILS
   ============================================ */

.body-details {
    margin: 0.8rem 0;
    background: #fafafa;
    border-radius: 6px;
}

.body-details summary {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.body-details summary:hover {
    color: #1a1a2e;
}

.source-body {
    padding: 0.8rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================
   SOURCE ACTIONS
   ============================================ */

.source-actions {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

.btn-front {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-front:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(233, 69, 96, 0.3);
}

/* ============================================
   MINI-CHART (Revenue Bars)
   ============================================ */

.source-chart {
    margin: 1rem 0;
    padding: 0.8rem;
    background: #f0f7ff;
    border-radius: 8px;
    border-left: 3px solid #1976d2;
}

.source-chart h5 {
    margin: 0 0 0.6rem;
    color: #1976d2;
    font-size: 0.9rem;
}

.mini-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.bar-label {
    width: 50px;
    font-size: 0.8rem;
    color: #666;
}

.bar-container {
    flex: 1;
    height: 12px;
    background: #e3f2fd;
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196f3 0%, #1976d2 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.bar-value {
    font-size: 0.8rem;
    color: #1976d2;
    min-width: 70px;
    text-align: right;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */

.error-message {
    padding: 1rem;
    background: #ffebee;
    color: #c62828;
    border-radius: 8px;
    border-left: 4px solid #c62828;
}

/* ============================================
   CHAT RESPONSE WRAPPER
   ============================================ */

.chat-response {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ============================================
   AUTO-LINKIFIED URLs
   ============================================ */

.auto-link {
    color: #1976d2;
    text-decoration: none;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.auto-link:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    color: #0d47a1;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

.source-body .auto-link {
    display: inline;
    word-break: break-all;
    white-space: normal;
}

/* ============================================
   RESPONSIVE - Mobile First
   ============================================ */

@media (max-width: 768px) {
    /* Metadata Bar */
    .metadata-bar {
        gap: 0.4rem;
        padding: 0.5rem 0.8rem;
        flex-wrap: wrap;
    }
    
    .meta-item {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .stat-item {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .stat-item span {
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    /* Source Details */
    .source-detail {
        margin-bottom: 0.6rem;
    }
    
    .source-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .source-meta {
        font-size: 0.75rem;
    }
    
    .att-badge {
        margin-left: 0;
        margin-top: 0.2rem;
    }
    
    .source-content {
        padding: 0.8rem;
    }
    
    /* Source Table */
    .source-table {
        font-size: 0.8rem;
    }
    
    .source-table th {
        width: 70px;
        padding-right: 0.4rem;
        font-size: 0.75rem;
    }
    
    .source-table td {
        font-size: 0.8rem;
    }
    
    /* Attachments */
    .source-attachments {
        padding: 0.6rem;
    }
    
    .attachment-item {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .att-link {
        font-size: 0.85rem;
        word-break: break-all;
    }
    
    .att-meta {
        font-size: 0.7rem;
    }
    
    /* Body Details */
    .body-details summary {
        font-size: 0.85rem;
        padding: 0.5rem 0.6rem;
    }
    
    .source-body {
        padding: 0.6rem;
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    /* Source Actions */
    .source-actions {
        padding-top: 0.6rem;
    }
    
    .btn-front {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        display: block;
        text-align: center;
    }
    
    /* Mini Charts */
    .source-chart {
        padding: 0.6rem;
    }
    
    .source-chart h5 {
        font-size: 0.8rem;
    }
    
    .mini-bar {
        gap: 0.4rem;
    }
    
    .bar-label {
        width: 40px;
        font-size: 0.7rem;
    }
    
    .bar-container {
        height: 10px;
    }
    
    .bar-value {
        font-size: 0.7rem;
        min-width: 55px;
    }
    
    /* Answer Richtext */
    .answer-richtext {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .answer-richtext h1 {
        font-size: 1.3rem;
    }
    
    .answer-richtext h2 {
        font-size: 1.15rem;
    }
    
    .answer-richtext h3 {
        font-size: 1.05rem;
    }
    
    .answer-richtext table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
    }
    
    .answer-richtext table th,
    .answer-richtext table td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Sources Container */
    .sources-container h4 {
        font-size: 1rem;
    }
    
    /* Auto Links */
    .auto-link {
        font-size: 0.8em;
        padding: 0.1rem 0.3rem;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .metadata-bar {
        padding: 0.4rem 0.6rem;
    }
    
    .meta-item {
        font-size: 0.6rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;  /* Eine Spalte auf sehr kleinen Screens */
        gap: 0.3rem;
    }
    
    .stat-item {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .source-summary {
        font-size: 0.8rem;
    }
    
    .source-table th {
        width: 60px;
    }
    
    .answer-richtext {
        font-size: 0.85rem;
    }
}

/* ============================================
   ATTACHMENT PREVIEW MODAL
   ============================================ */

.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.preview-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    color: white;
    font-weight: 600;
}

.preview-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-close:hover {
    background: #e94560;
    transform: scale(1.1);
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #888;
    gap: 1rem;
}

.preview-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.preview-content {
    padding: 1rem;
    overflow: auto;
    max-height: calc(90vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f1a;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.preview-error {
    color: #e94560;
    padding: 2rem;
    text-align: center;
}

/* PDF Controls */
.pdf-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #16213e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-controls button {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pdf-controls button:hover:not(:disabled) {
    background: linear-gradient(135deg, #e94560 0%, #d63850 100%);
    border-color: #e94560;
}

.pdf-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#pdf-page-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
}

.pdf-canvas {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Preview Button im Attachment */
.att-preview-btn {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border: none;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 0.3rem;
    transition: all 0.2s ease;
}

.att-preview-btn:hover {
    background: linear-gradient(135deg, #e94560 0%, #d63850 100%);
    transform: scale(1.1);
}

/* Responsive Preview */
@media (max-width: 768px) {
    .preview-container {
        max-width: 98vw;
        max-height: 95vh;
        border-radius: 8px;
        margin: 10px;
    }
    
    .preview-header {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .preview-close {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .preview-content {
        max-height: calc(95vh - 120px);
        padding: 0.8rem;
    }
    
    .preview-image {
        max-height: 60vh;
    }
    
    .pdf-controls {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.5rem;
    }
    
    .pdf-controls button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    #pdf-page-info {
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .att-preview-btn {
        padding: 0.15rem 0.4rem;
        font-size: 0.75rem;
    }
}
