/**
 * PDF Preview Module Styles
 * Styling for the PDF preview and modal viewer
 */

/* PDF Preview Item */
.pdf-preview-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
    transition: all 0.3s ease;
    max-width: 250px;
    text-align: center;
}

.pdf-preview-item:hover {
    border-color: #2196F3;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pdf-preview-item i {
    margin-bottom: 10px;
    color: #2196F3;
}

.pdf-filename {
    margin: 10px 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    word-wrap: break-word;
    max-width: 210px;
}

/* Chat Layout - Single line, clickable - Matches chatCenter bubble style */
.pdf-chat-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    word-wrap: break-word;
    text-decoration: none;
}

.pdf-chat-item:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    text-decoration: none;
}

.pdf-chat-item i {
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.pdf-chat-filename {
    font-size: 14px;
    color: white;
    font-weight: normal;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

.pdf-chat-filename .timestamp-small {
    display: block;
    font-size: 12px;
    margin-top: 3px;
    font-weight: bold;
    color: #3b444b;
}

/* Chat Center - Incoming/Client messages (green) */
.pdf-chat-item.incoming-chatcenter {
    background-color: #28a745;
    border-radius: 15px 15px 15px 0;
}

/* Chat Center - Outgoing/Admin messages (blue) - default */
.pdf-chat-item.outgoing-chatcenter {
    background-color: #007bff;
    border-radius: 15px 15px 0 15px;
}

/* Archived Outgoing PDF - Gray background */
.archOutgoingFile .pdf-chat-item.outgoing-chatcenter {
    background-color: #D3D3D3;
    color: black;
}

.archOutgoingFile .pdf-chat-item.outgoing-chatcenter i,
.archOutgoingFile .pdf-chat-filename {
    color: black;
}

/* Archived Incoming PDF - Gray background */
.archIncomingFile .pdf-chat-item.incoming-chatcenter {
    background-color: #D3D3D3;
    color: black;
}

.archIncomingFile .pdf-chat-item.incoming-chatcenter i,
.archIncomingFile .pdf-chat-filename {
    color: black;
}

/* User Portal - Client messages (dark gray/black) */
.pdf-chat-item.client-user {
    background-color: #2c3e50;
    align-self: flex-start;
    margin-right: auto;
}

/* User Portal - Admin messages (blue) */
.pdf-chat-item.admin-user {
    background-color: #007bff;
    align-self: flex-end;
    margin-left: auto;
}

/* Action Buttons Container */
.pdf-action-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

/* Preview Button */
.pdf-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: #2196F3;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.pdf-preview-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
}

.pdf-preview-btn i {
    font-size: 12px;
    margin: 0;
    color: #fff;
}

/* Download Button (Inline) */
.pdf-download-btn-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: #4CAF50;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.pdf-download-btn-inline:hover {
    background-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.pdf-download-btn-inline i {
    font-size: 12px;
    margin: 0;
    color: #fff;
}

/* Modal Overlay */
.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.pdf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

/* Modal Content */
.pdf-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    margin: 2.5% auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f5f5f5;
    border-radius: 8px 8px 0 0;
}

.pdf-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Download Button */
.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background-color: #2196F3;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.pdf-download-btn:hover {
    background-color: #1976D2;
    color: #fff !important;
}

.pdf-download-btn i {
    font-size: 14px;
}

/* Close Button */
.pdf-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.pdf-close-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* Modal Body */
.pdf-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* PDF Iframe */
.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 8px 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }

    .pdf-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pdf-modal-title {
        font-size: 16px;
    }

    .pdf-modal-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .pdf-download-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .pdf-preview-item {
        max-width: 150px;
        padding: 15px;
    }

    .pdf-preview-item i {
        font-size: 36px !important;
    }

    .pdf-filename {
        font-size: 12px;
        max-width: 120px;
    }
}

/* Plaintext Layout - Simple clickable text links */
.pdf-plaintext-links {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.pdf-plaintext-view,
.pdf-plaintext-download {
    color: #24ace4;
    text-decoration: none;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-plaintext-view:hover,
.pdf-plaintext-download:hover {
    color: #1a8cc2;
    text-decoration: underline;
}
