/* Admin Messaging Pages - Shared Styles */

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #3f4147;
}

.data-table th {
    background: #2b2d31;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #b5bac1;
}

.data-table tr:hover {
    background: #2b2d31;
}

.data-table td {
    color: #dbdee1;
    font-size: 14px;
}

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

.status-badge.open { background: #5865f2; color: #fff; }
.status-badge.assigned { background: #f0b232; color: #000; }
.status-badge.waiting { background: #b5bac1; color: #000; }
.status-badge.resolved { background: #43b581; color: #fff; }
.status-badge.draft { background: #4f545c; color: #fff; }
.status-badge.scheduled { background: #f0b232; color: #000; }
.status-badge.sending { background: #5865f2; color: #fff; }
.status-badge.sent { background: #43b581; color: #fff; }
.status-badge.cancelled { background: #da373c; color: #fff; }
.status-badge.active { background: #43b581; color: #fff; }
.status-badge.inactive { background: #4f545c; color: #fff; }
.status-badge.pending { background: #f0b232; color: #000; }
.status-badge.approved { background: #43b581; color: #fff; }
.status-badge.rejected { background: #da373c; color: #fff; }

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.low { background: #4f545c; color: #b5bac1; }
.priority-badge.normal { background: #5865f2; color: #fff; }
.priority-badge.urgent { background: #da373c; color: #fff; }

/* Action Buttons in Tables */
.table-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-action.primary { background: #5865f2; color: #fff; }
.btn-action.primary:hover { background: #4752c4; }
.btn-action.success { background: #43b581; color: #fff; }
.btn-action.success:hover { background: #3ca374; }
.btn-action.danger { background: #da373c; color: #fff; }
.btn-action.danger:hover { background: #c53030; }
.btn-action.secondary { background: #4f545c; color: #fff; }
.btn-action.secondary:hover { background: #5d6269; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #b5bac1;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: #dbdee1;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #b5bac1;
}

.loading-state i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

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

/* Stats Cards */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #2b2d31;
    border: 1px solid #3f4147;
    border-radius: 8px;
    padding: 16px 20px;
    flex: 1;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #b5bac1;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Detail Panel */
.detail-panel {
    background: #2b2d31;
    border: 1px solid #3f4147;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.detail-panel h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3f4147;
}

.detail-row {
    display: flex;
    margin-bottom: 12px;
}

.detail-row .label {
    width: 120px;
    font-size: 12px;
    color: #b5bac1;
    text-transform: uppercase;
}

.detail-row .value {
    flex: 1;
    color: #dbdee1;
}

/* Message Thread */
.message-thread {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: #1e1f22;
    border-radius: 8px;
    margin-bottom: 16px;
}

.thread-message {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #3f4147;
}

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

.thread-message .sender {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.thread-message .sender.admin {
    color: #5865f2;
}

.thread-message .sender.bot {
    color: #43b581;
}

.thread-message .content {
    color: #dbdee1;
    line-height: 1.5;
}

.thread-message .timestamp {
    font-size: 11px;
    color: #72767d;
    margin-top: 4px;
}

/* Reply Box */
.reply-box {
    display: flex;
    gap: 12px;
}

.reply-box textarea {
    flex: 1;
    background: #1e1f22;
    border: 1px solid #3f4147;
    border-radius: 6px;
    padding: 12px;
    color: #dbdee1;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.reply-box textarea:focus {
    outline: none;
    border-color: #5865f2;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #2b2d31;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #3f4147;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #b5bac1;
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #3f4147;
}

/* Form Elements - Extended */
.form-textarea {
    width: 100%;
    background: #1e1f22;
    border: 1px solid #3f4147;
    border-radius: 6px;
    padding: 12px;
    color: #dbdee1;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: #5865f2;
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: #2b2d31;
    border-bottom: 1px solid #3f4147;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #b5bac1;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: #dbdee1;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #5865f2;
}

.tab-btn .count {
    background: #4f545c;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

.tab-btn.active .count {
    background: #5865f2;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #4f545c;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: #43b581;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
}

.pagination-btn {
    padding: 8px 16px;
    background: #4f545c;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    background: #5d6269;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: #b5bac1;
    font-size: 13px;
}

/* Filters */
.filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    color: #b5bac1;
}

.filter-select {
    background: #1e1f22;
    border: 1px solid #3f4147;
    border-radius: 4px;
    padding: 8px 12px;
    color: #dbdee1;
    font-size: 13px;
}

.filter-select:focus {
    outline: none;
    border-color: #5865f2;
}

/* Clickable Row */
.data-table tr.clickable {
    cursor: pointer;
}

.data-table tr.clickable:hover {
    background: #36373d;
}

/* Internal Notes */
.internal-notes {
    background: #1e1f22;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.internal-notes h4 {
    font-size: 14px;
    color: #f0b232;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-item {
    padding: 12px;
    background: #2b2d31;
    border-radius: 6px;
    margin-bottom: 8px;
}

.note-item:last-child {
    margin-bottom: 0;
}

.note-item .note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #b5bac1;
}

.note-item .note-content {
    color: #dbdee1;
    font-size: 14px;
}

/* Segment Preview */
.segment-preview {
    background: #1e1f22;
    border-radius: 8px;
    padding: 16px;
}

.segment-preview .preview-count {
    font-size: 24px;
    font-weight: 700;
    color: #5865f2;
}

.segment-preview .preview-label {
    font-size: 12px;
    color: #b5bac1;
}
