/* Main Container */
.message-system-container {
    background: #fff;
    padding-bottom: 40px;
}

.page-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #3498db;
    font-size: 28px;
    letter-spacing: -0.5px;
}

.page-title i {
    color: #3498db;
    margin-right: 10px;
}

.message-main-row {
    background: #fff;
    position: relative;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    border-radius: 0 25px 25px 0;
    box-shadow: 2px 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    width: 50px;
    box-shadow: 3px 6px 16px rgba(102, 126, 234, 0.6);
    transform: translateX(2px);
}

.sidebar-toggle-btn i {
    font-size: 18px;
}

/* Left Sidebar */
.message-sidebar-panel {
    border: none;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.message-sidebar-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.sidebar-heading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    padding: 15px 18px;
    transition: all 0.3s ease;
}

.sidebar-heading:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.sidebar-heading .panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.sidebar-heading .panel-title i {
    margin-right: 8px;
}

.toggle-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.sidebar-column {
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar-column.collapsed {
    max-width: 0;
    min-width: 0;
    flex: 0 0 0;
    padding: 0;
    margin: 0;
}

.sidebar-column.collapsed .message-sidebar-panel {
    display: none;
}

.message-sidebar {
    background: #fff;
    margin-bottom: 0;
}

.message-sidebar .list-group-item {
    border-radius: 0;
    border: none;
    border-left: 4px solid transparent;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 14px 18px;
    color: #5a6c7d;
    font-size: 14px;
    font-weight: 500;
}

.message-sidebar .list-group-item:hover {
    background: linear-gradient(90deg, #f8f9ff 0%, #fff 100%);
    border-left-color: #667eea;
    transform: translateX(4px);
    padding-left: 22px;
}

.message-sidebar .list-group-item.active {
    border-left-color: #667eea;
    background: linear-gradient(90deg, #eef2ff 0%, #fff 100%);
    color: #667eea;
    font-weight: 700;
}

.message-sidebar .list-group-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    color: #95a5a6;
    font-size: 15px;
}

.message-sidebar .list-group-item.active i {
    color: #667eea;
}

.message-sidebar .badge {
    background-color: #95a5a6;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.message-sidebar .badge-primary {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

/* Message List Panel */
.message-list-panel {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.message-list-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.message-list-panel .panel-heading {
    background: #fff;
    border-bottom: 1px solid #ecf0f1;
    padding: 16px 18px;
}

/* Modern Search Box */
.message-search-wrapper {
    position: relative;
    width: 100%;
}

.message-search-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

.message-search-input {
    width: 100%;
    border: 2px solid #ecf0f1;
    border-radius: 25px;
    padding: 10px 18px 10px 42px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 500;
}

.message-search-input:focus {
    background: #fff;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.message-search-input::placeholder {
    color: #bdc3c7;
    font-weight: 400;
}

/* Message Actions Bar */
.message-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #ecf0f1;
}

.select-all-label {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    color: #5a6c7d;
    font-weight: 600;
    transition: color 0.2s ease;
}

.select-all-label:hover {
    color: #667eea;
}

.select-all-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.select-all-label span {
    user-select: none;
}

.bulk-actions {
    display: flex;
    gap: 6px;
}

.bulk-actions .btn-xs {
    padding: 6px;
    font-size: 12px;
    border-radius: 50%;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ecf0f1;
    background: #fff;
    color: #5a6c7d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Text button variant for Confirm Delete */
.bulk-actions .btn-xs:not(:has(i:only-child)) {
    width: auto;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.bulk-actions .btn-xs:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.bulk-actions .btn-xs.btn-danger {
    background: #fff;
    border-color: #ecf0f1;
    color: #e74c3c;
}

.bulk-actions .btn-xs.btn-danger:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.bulk-actions .btn-xs i {
    font-size: 12px;
    margin: 0;
}

/* Icon margin for text buttons */
.bulk-actions .btn-xs:not(:has(i:only-child)) i {
    margin-right: 6px;
}

.message-list-container {
    padding: 0;
    max-height: 550px;
    overflow-y: auto;
    background: #fff;
}

/* Custom Scrollbar */
.message-list-container::-webkit-scrollbar {
    width: 6px;
}

.message-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-list-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.message-list-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Message Items */
.message-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid #ecf0f1;
    border-radius: 0 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    position: relative;
    overflow: hidden;
}

.message-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.message-item:hover::before {
    width: 100%;
}

.message-item:hover {
    background: #f8f9ff;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    border-left: 3px solid #667eea;
}

.message-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-left: 3px solid #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.message-item.message-unread {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.04) 0%, #fff 100%);
    border-left: 3px solid #667eea;
}

.message-item.message-unread:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, #f8f9ff 100%);
}

.message-item.active .message-subject,
.message-item.active strong,
.message-item.active .message-header .pull-right {
    color: #fff;
}

.message-item.active .label {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.message-header {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
    position: relative;
}

.message-checkbox {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.message-item .label {
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.message-item strong {
    color: #2c3e50;
    font-size: 13px;
    flex: 1;
    font-weight: 600;
    letter-spacing: 0.2px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-item.message-unread strong {
    color: #667eea;
    font-weight: 700;
}

.message-header .pull-right {
    font-size: 11px;
    color: #95a5a6;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.message-item.active .message-header .pull-right {
    color: rgba(255, 255, 255, 0.9);
}

.message-subject {
    font-size: 12px;
    margin-bottom: 4px;
    margin-left: 24px;
    padding-right: 80px;
    color: #7f8c8d;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-item.message-unread .message-subject {
    font-weight: 700;
    color: #34495e;
}

.message-preview {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-left: 24px;
    padding-right: 80px;
}

/* Message Content Panel */
.message-content-panel {
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.message-content-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.message-content-panel .panel-heading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 16px 20px;
}

.message-content-panel .panel-heading h4 {
    margin: 0;
    font-size: 17px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.message-content-panel .panel-heading .btn-group .btn-xs {
    padding: 6px;
    font-size: 12px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.message-content-panel .panel-heading .btn-group .btn-xs:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.message-content-panel .panel-heading .btn-group .btn-xs.btn-danger {
    background: rgba(231, 76, 60, 0.9);
    border-color: rgba(231, 76, 60, 0.5);
    color: #fff;
}

.message-content-panel .panel-heading .btn-group .btn-xs.btn-danger:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
}

.message-content-panel .panel-heading .btn-group .btn-xs i {
    font-size: 12px;
    margin: 0;
}

.message-content-panel .btn-group .btn {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.message-content-panel .btn-group .btn i {
    font-size: 12px;
}

.message-content-panel .panel-heading .btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.message-content-panel .panel-heading .btn-sm i {
    font-size: 12px;
}

.message-content-panel .panel-body {
    padding: 24px;
    max-height: 550px;
    overflow-y: auto;
    background: #fff;
}

/* Message Meta */
.message-meta {
    background: linear-gradient(180deg, #f8f9ff 0%, #fff 100%);
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.message-meta>div {
    margin-bottom: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.message-meta>div:last-child {
    margin-bottom: 0;
}

.message-meta strong {
    display: inline-block;
    min-width: 65px;
    color: #667eea;
    font-weight: 700;
    margin-right: 8px;
}

.message-meta .text-muted {
    color: #5a6c7d;
    font-weight: 500;
}

/* Message Body */
.message-body {
    font-size: 14px;
    line-height: 1.8;
    color: #2c3e50;
    padding: 20px;
    background: #fff;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    min-height: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Reply Section */
.message-reply-section {
    background: linear-gradient(180deg, #f8f9ff 0%, #fff 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ecf0f1;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.message-reply-section h5 {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.message-reply-section h5 i {
    color: #667eea;
    margin-right: 8px;
    font-size: 16px;
}

.reply-textarea {
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    font-size: 14px;
    padding: 14px;
    transition: all 0.3s ease;
    line-height: 1.6;
    font-family: inherit;
}

.reply-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
    background: #fff;
}

.btn-send-reply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-send-reply:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.btn-send-reply:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-send-reply i {
    margin-right: 8px;
    font-size: 13px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    width: 360px;
}

.toast {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 5px solid;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.toast:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.toast.success {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.05) 0%, #fff 100%);
}

.toast.error {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.05) 0%, #fff 100%);
}

.toast.info {
    border-left-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, #fff 100%);
}

.toast.warning {
    border-left-color: #f39c12;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.05) 0%, #fff 100%);
}

.toast-icon {
    font-size: 22px;
    margin-right: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.toast.success .toast-icon {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.toast.error .toast-icon {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.toast.info .toast-icon {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.toast.warning .toast-icon {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #2c3e50;
    letter-spacing: 0.2px;
}

.toast-message {
    font-size: 13px;
    color: #5a6c7d;
    line-height: 1.4;
}

.toast-close {
    margin-left: 12px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #2c3e50;
    transform: rotate(90deg);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(350px);
        opacity: 0;
    }
}

/* Thread Messages - Chat Bubble Style */
.thread-messages-container {
    padding: 10px 0;
}

.thread-message {
    display: flex;
    margin-bottom: 16px;
}

.thread-message.message-from-me {
    justify-content: flex-end;
}

.thread-message.message-from-them {
    justify-content: flex-start;
}

.message-bubble {
    position: relative;
    padding: 6px 10px;
    border-radius: 12px;
    max-width: 50%;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: bubbleIn 0.3s ease;
    font-size: 12px;
    line-height: 1.3;
}

.message-from-me .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-from-them .message-bubble {
    background: #f8f9ff;
    color: #2c3e50;
    border: 1px solid #ecf0f1;
    border-bottom-left-radius: 4px;
}

.message-bubble .message-sender {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.message-from-me .message-sender {
    color: rgba(255, 255, 255, 0.9);
}

.message-from-them .message-sender {
    color: #667eea;
}

.message-bubble .message-bubble-text {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 6px;
}

.message-bubble .message-time {
    font-size: 10px;
    text-align: right;
    font-weight: 500;
}

.message-from-me .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.message-from-them .message-time {
    color: #95a5a6;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Thread count badge in message list */
.message-subject .text-muted {
    font-size: 11px;
    margin-left: 6px;
}

/* Responsive */
@media (max-width: 768px) {

    .message-sidebar-panel,
    .message-list-panel,
    .message-content-panel {
        margin-bottom: 10px;
    }

    .message-bubble {
        max-width: 90%;
    }

    /* Compact sidebar on mobile - horizontal scroll */
    .sidebar-column .message-sidebar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    .sidebar-column .message-sidebar .list-group-item {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 0;
    }

    .sidebar-column .sidebar-heading {
        display: none;
    }

    /* Hide empty content panel (placeholder) on mobile */
    .message-content-empty {
        display: none !important;
    }

    /* Improve message list items on mobile */
    .message-item {
        padding: 10px 12px !important;
    }

    .message-item .message-preview {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
        max-width: 100%;
    }

    .message-item .message-subject {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .message-item .message-header strong {
        font-size: 13px;
    }

    /* Message list max height - taller on mobile */
    .message-list-container {
        max-height: 400px !important;
    }

    /* Search input compact */
    .message-search-input {
        font-size: 14px !important;
        padding: 6px 10px 6px 30px !important;
    }

    /* Actions bar compact */
    .message-actions-bar {
        padding: 5px 10px !important;
        font-size: 12px;
    }
}

/* ============================================
   CONTACT SELLER POPUP (PRODUCT PAGE)
   ============================================ */

.contact-seller-popup {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
}

.contact-seller-popup.active {
    right: 0;
}

.contact-seller-panel {
    width: 450px;
    max-width: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.contact-seller-popup.active .contact-seller-panel {
    transform: translateX(0);
}

.contact-seller-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-seller-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.contact-seller-header .close-popup {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.contact-seller-header .close-popup:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.contact-seller-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.seller-info-block {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.seller-info-block .seller-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.seller-info-block .seller-rating {
    color: #f39c12;
}

.seller-info-block .seller-rating span {
    color: #7f8c8d;
    margin-left: 5px;
    font-size: 14px;
}

.product-reference {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    color: #2c3e50;
}

.contact-seller-body .form-group {
    margin-bottom: 20px;
}

.contact-seller-body .form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.contact-seller-body .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.contact-seller-body .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.contact-seller-body textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.form-actions .btn {
    padding: 10px 25px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.form-actions .btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.form-actions .btn-secondary:hover {
    background: #7f8c8d;
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.form-actions .btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .contact-seller-panel {
        width: 100%;
    }
}

/* Toast Notification */
.contact-seller-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-seller-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.contact-seller-toast.toast-success {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    color: #fff;
}

.contact-seller-toast.toast-success::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
}

.contact-seller-toast.toast-error {
    background: linear-gradient(135deg, #f85032 0%, #e73827 100%);
    color: #fff;
}

.contact-seller-toast.toast-error::before {
    content: '✕';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
}

@media (max-width: 768px) {
    .contact-seller-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* ============================================
   SELLER CONTACT PAGE
   ============================================ */

.seller-contact-page {
    padding-bottom: 0;
}

.seller-contact-page .page-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    font-size: 26px;
}

.seller-contact-page .page-title i {
    color: #667eea;
    margin-right: 10px;
}

/* Product Info Card */
.product-info-card,
.seller-info-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    overflow: hidden;
}

.product-info-header,
.seller-info-header {
    /* background: linear-gradient(135deg, #5a6c7d 0%, #3d4f5f 100%); */
    background: linear-gradient(135deg, #f8f9fa 0%, #DCE1E7 100%);
    color: #fff;
    padding: 15px 20px;
}

.product-info-header h3,
.seller-info-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.product-info-body,
.seller-info-body {
    padding: 25px;
}

.product-image-wrapper {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.product-image-wrapper img {
    max-width: 100%;
    border-radius: 4px;
}

.product-title {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.product-details {
    margin-bottom: 20px;
}

.detail-row {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 100px;
    display: inline-block;
}

.detail-value {
    color: #2c3e50;
}

.price-value {
    font-size: 20px;
    font-weight: 700;
    color: #04a12b;
}

/* PBS standard red pill badge — used for Free Shipping / Free Returns
   markers on the contact-seller page. Matches the .btn-red palette
   without being interactive. */
.pbs-badge-red {
    display: inline-block;
    margin: 0 10px 0 0;
    padding: 0 12px;
    background-color: #ff0000;
    color: #ffffff;
    font-weight: 700;
    font-style: italic;
    line-height: 1.8;
    transform: skew(-15deg);
    border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #27ae60;
    color: #fff;
}

.badge-info {
    background: #3498db;
    color: #fff;
}

.product-actions {
    margin-top: 15px;
}

/* Seller Info */
.seller-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.seller-name-row h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.seller-rating {
    color: #f39c12;
}

.seller-rating .rating-value {
    color: #7f8c8d;
    margin-left: 5px;
    font-size: 14px;
}

.seller-stats {
    margin-bottom: 20px;
}

.stat-item {
    padding: 10px 0;
    color: #2c3e50;
}

.stat-item i {
    color: #27ae60;
    margin-right: 8px;
}

/* Fixed Footer */
.seller-contact-footer {
    position: relative;
    margin: 30px 0 0;
    background: #fff;
    border-top: 3px solid #b31942;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding: 18px 0;
}

.seller-contact-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seller-contact-footer .footer-info strong {
    color: #2c3e50;
    font-size: 16px;
    display: block;
}

.seller-contact-footer .footer-info p {
    color: #7f8c8d;
    margin: 5px 0 0 0;
    font-size: 14px;
}

.seller-contact-footer .btn-lg {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* Notification Bell Styles */
.notification-bell-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0 10px;
    z-index: 2;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 8px 12px;
}

.notification-bell:hover {
    color: #667eea;
}

.notification-bell i {
    font-size: 22px;
    line-height: 1;
}

.notification-bell .badge1 {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    margin-top: 2px;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    max-height: 400px;
    overflow: hidden;
}

.notification-bell-wrapper:hover .notification-dropdown,
.notification-dropdown:hover {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Add invisible bridge to prevent gap */
.notification-bell-wrapper::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -10px;
    right: -10px;
    height: 5px;
    z-index: 9999;
}

.notification-header {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
    text-decoration: none;
    color: #333;
}

.notification-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
}

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

/* Keep dropdown open when hovering over it */
.notification-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.notification-sender {
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 4px;
}

.notification-subject {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 11px;
    color: #999;
}

.notification-footer {
    padding: 12px 15px;
    background: #f8f9fa;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

.notification-footer a {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.notification-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.notification-empty {
    padding: 30px 15px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Arrow pointer for dropdown */
.notification-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .seller-contact-footer .footer-content {
        flex-direction: column;
        gap: 15px;
    }

    .seller-contact-footer .footer-info {
        text-align: center;
    }

    .seller-name-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .notification-dropdown {
        width: 280px;
        right: -50px;
    }

    .notification-dropdown::before {
        right: 65px;
    }
}

/* ======================================== NOTIFICATION BELL - Header Messages ======================================== */

.notification-bell-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 15px;
}

.notification-bell {
    position: relative;
    display: inline-block;
    color: #333;
    font-size: 20px;
    padding: 0px 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    color: #667eea;
    text-decoration: none;
}

.notification-bell i {
    font-size: 22px;
}

.notification-bell .badge1 {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    margin-top: 2px;
}

.notification-bell-wrapper:hover .notification-dropdown,
.notification-dropdown:hover {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

.notification-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8f9fa;
    text-decoration: none;
}

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

.notification-sender {
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 4px;
}

.notification-subject {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 11px;
    color: #999;
}

.notification-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.notification-footer a {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.notification-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.notification-empty {
    padding: 30px 15px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

@media (max-width: 768px) {
    .notification-dropdown {
        width: 300px;
        right: -50px;
    }

    .notification-bell-wrapper {
        margin: 0 8px;
    }
}

/* ============================================================
   Inline-style extraction from message.twig
   (Most inline rules duplicated existing selectors; only these
   needed new classes — empty-state, no-selection, etc.)
   ============================================================ */

/* Sidebar toggle starts hidden; JS fadeIn() reveals it when sidebar collapses. */
.sidebar-toggle-btn[hidden] {
    display: none;
}

/* Message list: empty-state ("No messages found"). */
.msg-list-empty {
    padding: 40px;
}
.msg-list-empty-icon {
    font-size: 48px;
    color: #ccc;
}
.msg-list-empty-text {
    margin-top: 10px;
    color: #999;
}

/* Strip Bootstrap's default bottom margin off the inner list-group. */
.message-list-container > .list-group {
    margin-bottom: 0;
}

/* Message-row date and thread-count label. */
.msg-item-date,
.msg-count-label {
    font-size: 11px;
}

/* Content pane: nothing-selected empty state. */
.message-content-panel .panel-body.msg-no-selection {
    padding: 60px 20px;
}
.msg-no-selection-img {
    width: 180px;
    margin-bottom: 20px;
}
.msg-no-selection-title {
    color: #333;
    margin-bottom: 10px;
}
.msg-no-selection-text {
    color: #999;
}

/* Reply form: "Send me a copy" label + checkbox. */
.msg-copy-label {
    font-weight: normal;
    cursor: pointer;
}
#sendMeCopy {
    margin-right: 8px;
}