/**
 * Merge/Split Support Panel Styles
 *
 * @package Polanger_Ticket_System_Pro
 * @since   1.1.2
 */

/* Merged Conversations Banner */
.pgtsp-merged-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 16px;
    color: #fff;
}

.pgtsp-merged-banner-icon {
    font-size: 20px;
    opacity: 0.9;
}

.pgtsp-merged-banner-text {
    flex: 1;
    font-size: 14px;
}

.pgtsp-merged-banner-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.pgtsp-merged-banner-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Merged Into Banner (for source tickets) */
.pgtsp-merged-into-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #856404;
}

.pgtsp-merged-into-banner-icon {
    font-size: 20px;
}

.pgtsp-merged-into-banner-text {
    flex: 1;
    font-size: 14px;
}

.pgtsp-merged-into-banner a {
    color: #856404;
    font-weight: 600;
    text-decoration: underline;
}

/* Merged Conversations Modal */
.pgtsp-merged-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgtsp-merged-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.pgtsp-merged-modal-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.pgtsp-merged-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.pgtsp-merged-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pgtsp-merged-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.pgtsp-merged-modal-close:hover {
    opacity: 1;
}

.pgtsp-merged-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Merged Ticket Tabs */
.pgtsp-merged-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.pgtsp-merged-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.pgtsp-merged-tab:hover {
    color: #333;
    background: #fff;
}

.pgtsp-merged-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #fff;
}

.pgtsp-merged-tab-info {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Merged Messages */
.pgtsp-merged-messages {
    padding: 16px;
}

.pgtsp-merged-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.pgtsp-merged-message:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pgtsp-merged-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pgtsp-merged-message-content {
    flex: 1;
}

.pgtsp-merged-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.pgtsp-merged-message-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pgtsp-merged-message-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.pgtsp-merged-message-badge.customer {
    background: #e3f2fd;
    color: #1565c0;
}

.pgtsp-merged-message-badge.support {
    background: #e8f5e9;
    color: #2e7d32;
}

.pgtsp-merged-message-badge.internal {
    background: #fff3e0;
    color: #e65100;
}

.pgtsp-merged-message-time {
    font-size: 11px;
    color: #999;
}

.pgtsp-merged-message-text {
    color: #444;
    font-size: 14px;
    line-height: 1.5;
}

/* Loading State */
.pgtsp-merged-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.pgtsp-merged-loading .spinner {
    margin-right: 10px;
}

/* Empty State */
.pgtsp-merged-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Merged Message Attachments */
.pgtsp-merged-message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.pgtsp-merged-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.pgtsp-merged-attachment:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.pgtsp-merged-attachment-image {
    flex-direction: column;
    padding: 8px;
}

.pgtsp-merged-attachment-image img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 4px;
    object-fit: cover;
}

.pgtsp-merged-attachment-file .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #667eea;
}

.pgtsp-attachment-info {
    display: flex;
    flex-direction: column;
}

.pgtsp-attachment-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pgtsp-attachment-size {
    font-size: 10px;
    color: #999;
}

/* Modal Footer */
.pgtsp-merged-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    text-align: right;
}

.pgtsp-merged-modal-footer button {
    padding: 8px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.pgtsp-merged-modal-footer button:hover {
    background: #5a6fd6;
}

/* Responsive */
@media (max-width: 600px) {
    .pgtsp-merged-modal-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .pgtsp-merged-modal-header,
    .pgtsp-merged-modal-footer {
        border-radius: 0;
    }

    .pgtsp-merged-banner {
        flex-direction: column;
        text-align: center;
    }
}
