/* Loading and submission states */
.complaint-form.submitting {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.complaint-form.submitting::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

/* Loading spinner for submit button */
.btn.submitting {
    position: relative;
    color: transparent !important;
}

.btn.submitting::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 1s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* General error message styling */
.general-error {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    animation: slideDown 0.5s ease-out;
}

.general-error i {
    font-size: 1.2rem;
    margin-left: 10px;
    color: #dc2626;
}

/* Success message with reference number */
.success-message strong {
    display: block;
    font-size: 1.1rem;
    margin: 5px 0;
    color: #166534;
}

/* Reference number display */
.reference-number {
    background: #dcfce7;
    border: 2px solid #22c55e;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.reference-number .ref-label {
    font-size: 0.9rem;
    color: #166534;
    margin-bottom: 5px;
}

.reference-number .ref-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #15803d;
    letter-spacing: 1px;
}

/* Progress indicator */
.submission-progress {
    display: none;
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.submission-progress.active {
    display: block;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    position: relative;
}

.progress-step::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
}

.progress-step.active::before {
    background: #3b82f6;
}

.progress-step.completed::before {
    background: #10b981;
}

.progress-step .step-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 5px;
}

.progress-step.active .step-icon {
    background: #3b82f6;
    color: white;
}

.progress-step.completed .step-icon {
    background: #10b981;
    color: white;
}

.progress-step .step-text {
    font-size: 0.8rem;
    color: #6b7280;
}

.progress-step.active .step-text {
    color: #3b82f6;
    font-weight: 600;
}

.progress-step.completed .step-text {
    color: #10b981;
}

/* Network status indicator */
.network-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #f59e0b;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
    z-index: 1100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.network-status.offline {
    background: #ef4444;
    display: block;
}

.network-status.online {
    background: #10b981;
    display: block;
    animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .progress-steps {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-step {
        flex: none;
    }
    
    .progress-step::before {
        display: none;
    }
    
    .network-status {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .reference-number {
        padding: 10px;
    }
    
    .reference-number .ref-value {
        font-size: 1.1rem;
    }
}

/* Print styles */
@media print {
    .submission-progress,
    .network-status {
        display: none !important;
    }
    
    .success-message {
        border: 2px solid #000;
        background: white !important;
        color: #000 !important;
    }
    
    .reference-number {
        border: 2px solid #000;
        background: white !important;
    }
}