/* Enhanced Status Badges for KIUAE Translation Platform */

/* ===== Enhanced Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: default;
    white-space: nowrap; /* Prevent text wrapping */
    min-height: 32px; /* Ensure consistent height */
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.status-badge:hover::before {
    left: 100%;
}

/* Status-specific styling */
.status-pending {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.status-processing {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #0d47a1;
    border: 1px solid #64b5f6;
    animation: processingPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4);
    position: relative;
    min-width: 140px; /* Ensure enough space for spinning icon + text */
    justify-content: flex-start; /* Align content to start for better spacing */
    padding-left: 12px; /* Extra left padding for spinning icon */
}

/* Ensure the spinning icon in processing status has proper spacing */
.status-processing i {
    margin-right: 6px !important;
    flex-shrink: 0; /* Prevent icon from shrinking */
    width: 14px; /* Fixed width for consistent spacing */
    text-align: center; /* Center the spinning icon */
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.status-review {
    background: linear-gradient(135deg, #cce5ff 0%, #b3d9ff 100%);
    color: #0066cc;
    border: 1px solid #80bfff;
    box-shadow: 0 2px 4px rgba(30, 144, 255, 0.2);
}

.status-completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #a3d9a4;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.status-failed {
    background: linear-gradient(135deg, #f8d7da 0%, #f1b0b7 100%);
    color: #721c24;
    border: 1px solid #f1959b;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Processing animation */
@keyframes processingPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(23, 162, 184, 0.5);
    }
}

/* Progress indicator dots - removed conflicting ::after */

@keyframes progressDot {
    0%, 80%, 100% { opacity: 0; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* Enhanced translation status in tables and lists */
.translation-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    transition: all 0.3s ease;
}

/* Status icons */
.status-badge i,
.translation-status i {
    font-size: 0.9em;
    margin-right: 4px;
    flex-shrink: 0; /* Prevent icons from shrinking */
    width: 12px; /* Fixed width for consistent spacing */
    text-align: center; /* Center align icons */
}

.status-pending i { content: "\f017"; } /* clock */
.status-processing i { content: "\f110"; animation: spin 2s linear infinite; } /* spinner */
.status-review i { content: "\f06e"; } /* eye */
.status-completed i { content: "\f058"; } /* check-circle */
.status-failed i { content: "\f057"; } /* times-circle */

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

/* ===== Enhanced Progress Indicators ===== */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
}

.progress-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #17a2b8, #007bff);
    border-radius: 12px 0 0 12px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.1;
}

.progress-indicator.processing::before { width: 60%; }
.progress-indicator.review::before { width: 80%; }
.progress-indicator.completed::before { width: 100%; }

.progress-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.progress-indicator.processing .progress-icon {
    background: #17a2b8;
    color: white;
    animation: rotateIcon 2s linear infinite;
}

.progress-indicator.review .progress-icon {
    background: #007bff;
    color: white;
}

.progress-indicator.completed .progress-icon {
    background: #28a745;
    color: white;
}

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

.progress-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 2;
}

.progress-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.progress-subtitle {
    font-size: 0.8rem;
    color: #666;
}

/* ===== Enhanced Form Validation ===== */
.form-group.has-error .form-control,
.smart-form-group.has-error .smart-input,
.smart-form-group.has-error .smart-select {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    animation: shake 0.5s ease-in-out;
}

.form-group.has-warning .form-control,
.smart-form-group.has-warning .smart-input,
.smart-form-group.has-warning .smart-select {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.15);
    background: rgba(255, 248, 225, 0.8);
}

.form-group.has-success .form-control {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
}

.validation-message {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.validation-message.show {
    opacity: 1;
    transform: translateY(0);
}

.validation-message.error {
    color: #dc3545;
}

.validation-message.success {
    color: #28a745;
}

/* ===== Enhanced Loading States ===== */
.loading-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.loading-spinner-enhanced {
    position: relative;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.loading-spinner-enhanced::before,
.loading-spinner-enhanced::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spinEnhanced 2s linear infinite;
}

.loading-spinner-enhanced::before {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(23, 162, 184, 0.1);
    border-top-color: #17a2b8;
}

.loading-spinner-enhanced::after {
    width: 32px;
    height: 32px;
    top: 8px;
    left: 8px;
    border: 2px solid rgba(0, 123, 255, 0.1);
    border-top-color: #007bff;
    animation-direction: reverse;
    animation-duration: 1.5s;
}

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

.loading-text-enhanced {
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.loading-subtext {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
    line-height: 1.4;
}

/* ===== Enhanced Buttons ===== */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-enhanced:hover::before {
    left: 100%;
}

.btn-enhanced:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-enhanced:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

/* ===== Character Counter Enhancement ===== */
.character-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #495057;
}

.counter-value {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.counter-warning {
    border-color: #ffc107;
    background: #fff8e1;
}

.counter-danger {
    border-color: #dc3545;
    background: #ffebee;
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { background: #ffebee; }
    50% { background: #ffcdd2; }
}


/* ===== Enhanced Card Hover Effects ===== */
.card-enhanced {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e9ecef;
}

/* Hover effects removed for cleaner UI */

/* ===== Language Pair Enhancement ===== */
.language-pair-enhanced {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 1px solid #dee2e6;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 500;
}

.lang-code-enhanced {
    padding: 2px 6px;
    background: white;
    border-radius: 4px;
    color: #495057;
    border: 1px solid #dee2e6;
}

.language-arrow-enhanced {
    color: #007bff;
    font-weight: bold;
    animation: arrowFlow 2s ease-in-out infinite;
}

@keyframes arrowFlow {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(2px); opacity: 0.7; }
}

/* ===== Real-time Status Updates ===== */
.status-live-indicator {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
    border: 2px solid white;
    animation: livePulse 2s ease-in-out infinite;
    z-index: 10; /* Ensure it's above other elements */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* ===== Enhanced Workflow Cards ===== */
.workflow-card-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.workflow-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #17a2b8);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.workflow-card-enhanced:hover::before {
    transform: scaleX(1);
}

.workflow-card-enhanced:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 123, 255, 0.15);
}

/* ===== Toast Notifications Enhancement ===== */
.toast-enhanced {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 320px;
    max-width: 420px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-left: 5px solid #007bff;
    z-index: 1050;
    transform: translateX(calc(100% + 40px)) scale(0.95);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-enhanced.show {
    transform: translateX(0) scale(1);
}

.toast-enhanced.hide {
    transform: translateX(calc(100% + 40px)) scale(0.8);
    opacity: 0;
}

.toast-enhanced.success { border-left-color: #28a745; }
.toast-enhanced.error { border-left-color: #dc3545; }
.toast-enhanced.warning { border-left-color: #ffc107; }

.toast-header-enhanced {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.toast-body-enhanced {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transform-origin: left;
    animation: toastProgress linear forwards;
}

.toast-enhanced.success .toast-progress-bar {
    background: linear-gradient(90deg, #28a745, #1e7e34);
}

.toast-enhanced.error .toast-progress-bar {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.toast-enhanced.warning .toast-progress-bar {
    background: linear-gradient(90deg, #ffc107, #e0a800);
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.toast-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.toast-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #6c757d;
    margin-left: 8px;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* ===== Responsive Enhancements ===== */
@media (max-width: 768px) {
    .status-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .progress-indicator {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .character-counter {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .toast-enhanced {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ===== Accessibility Improvements ===== */
.status-badge[aria-label]::after {
    content: attr(aria-label);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.status-badge:hover::after {
    opacity: 1;
}

/* ===== Enhanced Progress Tracker Styles ===== */
.progress-tracker-enhanced {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 0;
    margin: 20px 0;
    border: 1px solid #dee2e6;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

/* Status Indicator Bar */
.status-indicator-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    position: relative;
    overflow: hidden;
}

.status-indicator-bar[data-status="processing"] {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-bottom: 3px solid #2196f3;
}

.status-indicator-bar[data-status="completed"] {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
    border-bottom: 3px solid #4caf50;
}

.status-indicator-bar[data-status="failed"] {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-bottom: 3px solid #f44336;
}

.status-indicator-bar[data-status="review"] {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-bottom: 3px solid #ff9800;
}

.status-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: statusGlow 3s ease-in-out infinite;
}

@keyframes statusGlow {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.status-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    z-index: 2;
    position: relative;
}

.processing-indicator {
    z-index: 2;
    position: relative;
}

.processing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.processing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2196f3;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.processing-dots span:nth-child(1) { animation-delay: 0s; }
.processing-dots span:nth-child(2) { animation-delay: 0.2s; }
.processing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

.progress-steps {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.step-connector[data-progress="processing"] {
    background: linear-gradient(90deg, #28a745 0%, #28a745 50%, #dee2e6 50%, #dee2e6 100%);
}

.step-connector[data-progress="review"] {
    background: linear-gradient(90deg, #28a745 0%, #28a745 66%, #dee2e6 66%, #dee2e6 100%);
}

.step-connector[data-progress="completed"] {
    background: #28a745;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .status-processing,
    .loading-spinner-enhanced::before,
    .loading-spinner-enhanced::after {
        animation: none;
    }
    
    .status-processing::after {
        animation: none;
        opacity: 1;
    }
}