/* Campaign Progress Tracker Styles */

.progress-tracker-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 500px;
    min-width: 450px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e5e5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.campaign-progress-tracker {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.campaign-progress-tracker.minimized .progress-tracker-content {
    display: none;
}

/* Header */
.progress-tracker-header {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-tracker-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 250px;
}

.progress-tracker-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 10px;
}

.progress-tracker-controls .btn {
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1;
    min-width: 20px;
    height: 20px;
}

/* Content */
.progress-tracker-content {
    padding: 16px;
}

/* Progress Section */
.progress-section {
    margin-bottom: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-text {
    font-weight: 600;
    color: #333;
}

.progress-stats {
    color: #666;
    font-size: 12px;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percentage {
    font-size: 12px;
    font-weight: 600;
    color: #4caf50;
    min-width: 30px;
    text-align: right;
}

/* Current Contact Section */
.current-contact-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.current-contact-header {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 4px;
}

.current-contact-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.contact-detail {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.detail-label {
    font-weight: 500;
    color: #666;
    min-width: 50px;
    margin-right: 6px;
}

.detail-value {
    color: #333;
    font-weight: 400;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100px;
}

/* Status Breakdown */
.status-breakdown {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.status-item {
    text-align: center;
    padding: 6px 2px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.status-item.status-completed {
    background: #f0f9ff;
    border-color: #d1d5db;
    color: #059669;
}

.status-item.status-in-progress {
    background: #f0f9ff;
    border-color: #d1d5db;
    color: #2563eb;
}

.status-item.status-failed {
    background: #fef2f2;
    border-color: #d1d5db;
    color: #dc2626;
}

.status-item.status-pending {
    background: #fffbeb;
    border-color: #d1d5db;
    color: #d97706;
}

.status-item.status-dnd {
    background: #fff3e0;
    border-color: #d1d5db;
    color: #ff9800;
}

.status-count {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.status-label {
    display: block;
    font-size: 9px;
    color: #666;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Errors Section */
.errors-section {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.errors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #c53030;
}

.errors-list {
    max-height: 100px;
    overflow-y: auto;
}

.error-item {
    background: white;
    border: 1px solid #fed7d7;
    border-radius: 3px;
    padding: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}

.error-item.error-capacity {
    border-color: #fbbf24;
    background-color: #fef3c7;
}

.error-item.error-api {
    border-color: #f87171;
    background-color: #fee2e2;
}

.error-item.error-call {
    border-color: #fed7d7;
    background-color: #fff5f5;
}

.error-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.error-type {
    font-weight: 700;
    font-size: 10px;
    margin-right: 6px;
    padding: 1px 4px;
    border-radius: 2px;
}

.error-capacity .error-type {
    background-color: #f59e0b;
    color: white;
}

.error-api .error-type {
    background-color: #ef4444;
    color: white;
}

.error-call .error-type {
    background-color: #dc2626;
    color: white;
}

.error-contact {
    font-weight: 600;
    color: #333;
}

.error-message {
    color: #c53030;
    margin-bottom: 2px;
    margin-left: 4px;
}

.error-time {
    color: #666;
    font-size: 10px;
    margin-left: 4px;
}

/* Actions */
.progress-tracker-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.progress-tracker-actions .btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 12px;
    min-width: 70px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .progress-tracker-overlay {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
        min-width: auto;
    }
    
    .current-contact-info {
        grid-template-columns: 1fr;
    }
    
    .status-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation for new items */
.progress-tracker-overlay {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Removed draggable functionality - not needed */

/* Loading state */
.progress-tracker-content.loading {
    opacity: 0.6;
    pointer-events: none;
}

.progress-tracker-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}