/**
 * Persistent Center Styling
 * Handles collapsible sidebar for Posting Center
 */

/* Container */
.persistent-center-container {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    background: white;
    border-left: 1px solid #d4d0c8;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

/* Minimized state - collapses to thin tab on right edge */
.persistent-center-container.minimized {
    transform: translateX(380px);
    cursor: pointer;
}

.persistent-center-container.minimized:hover {
    transform: translateX(370px);
}

.persistent-center-container.minimized .center-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 14px;
}

.persistent-center-container.minimized .center-content {
    display: none;
}

/* Header */
.center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #d4d0c8;
    background: linear-gradient(135deg, #8b5cf6 0%, #c4576a 100%);
    color: white;
    flex-shrink: 0;
}

.center-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.center-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Content */
.center-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #faf8f5;
}

/* Custom scrollbar */
.center-content::-webkit-scrollbar {
    width: 8px;
}

.center-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.center-content::-webkit-scrollbar-thumb {
    background: #c4c0b8;
    border-radius: 4px;
}

.center-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b6b6b;
}

/* ===== Posting Center Specific ===== */

.posting-sessions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.posting-session {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.session-info {
    flex: 1;
    padding-left: 40px;
}

.session-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #1e293b;
}

.session-platform {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f2ed;
    color: #6b6b6b;
    border-radius: 4px;
    font-size: 12px;
    text-transform: capitalize;
}

.session-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

    .session-status.active {
    background: var(--primary-100);
    color: var(--primary-600);
}

.session-status.success {
    background: var(--success-100);
    color: var(--success-700);
}

.session-status.error {
    background: var(--error-100);
    color: var(--error-700);
}
/* Progress bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #d4d0c8;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0 8px 0;
}

.progress-bar-container .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #c4576a 100%) !important;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #6b6b6b;
    margin-bottom: 12px;
}

.failed-count {
    color: #dc2626;
    font-weight: 500;
}

/* Breakdown */
.posting-breakdown {
    border-top: 1px solid #d4d0c8;
    padding-top: 12px;
    margin-top: 12px;
}

.breakdown-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.breakdown-label {
    color: #6b6b6b;
}

.breakdown-value {
    color: #1e293b;
    font-weight: 500;
}

/* Completion actions */
.completion-actions {
    border-top: 1px solid #d4d0c8;
    padding-top: 12px;
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #c4576a 100%);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}

.action-btn.primary:active {
    transform: translateY(0);
}

.action-btn svg {
    flex-shrink: 0;
}

/* Failed Transactions Section */
.failed-transactions-section {
    border-top: 1px solid #d4d0c8;
    padding-top: 12px;
    margin-top: 12px;
}

.failed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.failed-title {
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-link {
    background: none;
    border: none;
    color: #8b5cf6;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-link:hover {
    background: #fae8ec;
    color: #7c3aed;
}

.btn-link.retry {
    color: #dc2626;
}

.btn-link.retry:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.failed-transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.failed-transaction-item {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.failed-txn-info {
    flex: 1;
    min-width: 0;
}

.failed-txn-description {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.failed-txn-details {
    font-size: 12px;
    color: #6b6b6b;
    margin-bottom: 4px;
}

.failed-txn-error {
    font-size: 12px;
    color: #dc2626;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
    border-left: 2px solid #dc2626;
}

.btn-edit {
    background: white;
    border: 1px solid #c4c0b8;
    color: #6b6b6b;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-edit:hover {
    background: #faf8f5;
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.btn-edit:active {
    transform: scale(0.95);
}

/* Highlight animation for failed transaction */
@keyframes highlight-failed {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: #fef2f2;
    }
}

.highlight-failed {
    animation: highlight-failed 2s ease-in-out 3;
}

/* Posting Center Toolbar */
.posting-center-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.clear-completed-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f2ed;
    border: 1px solid #c4c0b8;
    border-radius: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-completed-btn:hover {
    background: #d4d0c8;
    border-color: #94a3b8;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clear-completed-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.clear-completed-btn svg {
    flex-shrink: 0;
}

/* Close Session Button */
.close-session-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #d4d0c8;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b6b6b;
    transition: all 0.2s;
    z-index: 10;
}

.close-session-btn svg {
    width: 14px;
    height: 14px;
}

.close-session-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
    transform: scale(1.15);
}

.close-session-btn:active {
    transform: scale(0.95);
}

.posting-session {
    position: relative;
    padding-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .persistent-center-container {
        width: 100%;
        max-width: 420px;
    }

    .persistent-center-container.minimized {
        transform: translateX(calc(100% - 40px));
    }
}
