/**
 * Loading States Component
 * Styles for loading spinners and button states
 */

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button Loading State */
.cta-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
    position: relative;
}

.cta-button.loading:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(255, 111, 97, 0.3);
}

.cta-button.loading .loading-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

/* Auth Button Loading */
.auth-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.auth-button.loading:hover {
    transform: none;
}

/* Form Validation States */
.form-group.has-error input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.has-success input {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.error-message {
    display: block;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

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

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-bar .strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-bar.strength-weak .strength-fill {
    width: 25%;
    background: #ef4444;
}

.strength-bar.strength-fair .strength-fill {
    width: 50%;
    background: #f59e0b;
}

.strength-bar.strength-good .strength-fill {
    width: 75%;
    background: #3b82f6;
}

.strength-bar.strength-strong .strength-fill {
    width: 100%;
    background: #10b981;
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Loading overlay for forms */
.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.form-loading-overlay .loading-spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
    border-color: rgba(255, 111, 97, 0.3);
    border-top-color: #ff6f61;
    margin-right: 0;
}

/* Dark mode loading spinner */
@media (prefers-color-scheme: dark) {
    .form-loading-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .loading-spinner {
        border-color: rgba(255, 255, 255, 0.2);
        border-top-color: rgba(255, 255, 255, 0.8);
    }
}
