/**
 * Tenant Status CSS
 * 
 * Styles for tenant provisioning status monitoring UI
 */

/* Provisioning Container */
.provisioning-container {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.provisioning-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #2196f3, transparent);
    animation: loading-line 2s linear infinite;
}

@keyframes loading-line {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Only show during provisioning */
.provisioning-only {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e3f2fd;
    border-top: 4px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
    flex-shrink: 0;
}

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

/* Status Messages */
.tenant-status-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tenant-status-message.progress {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196f3;
}

.tenant-status-message.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.tenant-status-message.failed {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.tenant-status-message.warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border-left: 4px solid #ff9800;
}

/* Instance Status Pills */
.instance-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-left: 10px;
}

.instance-status.ready {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.instance-status.provisioning {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #2196f3;
    animation: pulse-status 2s ease-in-out infinite;
}

.instance-status.failed {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.instance-status.pending {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ff9800;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Tenant Instance Cards */
.tenant-instance {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.tenant-instance:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.tenant-instance.provisioning {
    border-color: #2196f3;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.tenant-instance.provisioning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2196f3, #21cbf3, #2196f3);
    background-size: 200% 100%;
    animation: gradient-slide 2s ease-in-out infinite;
}

@keyframes gradient-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Retry Button */
.retry-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.retry-btn:hover {
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 90, 36, 0.3);
}

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

/* Progress Indicators */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.progress-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #757575;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0 10px;
    position: relative;
    transition: all 0.5s ease;
}

.progress-step.active {
    background: #2196f3;
    color: white;
    transform: scale(1.1);
}

.progress-step.completed {
    background: #4caf50;
    color: white;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 40px;
    height: 2px;
    background: #e0e0e0;
    transform: translateY(-50%);
    z-index: -1;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.completed::after {
    background: #4caf50;
}

/* Timing Information */
.timing-info {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.timing-info .elapsed {
    font-weight: 600;
    color: #2196f3;
}

.timing-info .estimated {
    font-style: italic;
    color: #757575;
}

/* Success Animation */
.success-animation {
    animation: success-bounce 0.6s ease-out;
}

@keyframes success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Error Animation */
.error-animation {
    animation: error-shake 0.5s ease-out;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .provisioning-container {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
    
    .tenant-status-message {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .progress-indicator {
        margin: 15px 0;
    }
    
    .progress-step {
        width: 25px;
        height: 25px;
        margin: 0 5px;
        font-size: 12px;
    }
    
    .progress-step::after {
        width: 30px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .provisioning-container {
        border-width: 3px;
    }
    
    .instance-status {
        border-width: 2px;
    }
    
    .tenant-status-message {
        border-left-width: 6px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
        border: 4px solid #2196f3;
    }
    
    .provisioning-container::before {
        animation: none;
    }
    
    .instance-status.provisioning {
        animation: none;
    }
    
    .tenant-instance.provisioning::before {
        animation: none;
    }
}