/* Loading Indicators CSS */

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Basic loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #D6DF23;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Loading spinner for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .loading-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin-right: 0;
}

.btn-loading .btn-text {
    opacity: 0;
}

/* 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: 1000;
    animation: fadeIn 0.3s ease;
}

.form-loading-overlay .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
}

.form-loading-overlay .loading-spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.form-loading-overlay .loading-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Success indicator */
.success-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #28a745;
    font-size: 14px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.success-indicator .checkmark {
    width: 16px;
    height: 16px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

/* Error indicator */
.error-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #dc3545;
    font-size: 14px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.error-indicator .error-icon {
    width: 16px;
    height: 16px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

/* Pulse loading for input fields */
.input-loading {
    position: relative;
}

.input-loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #D6DF23;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading skeleton for content */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.large {
    height: 20px;
}

.skeleton-text.small {
    height: 12px;
}

/* Save status indicators */
.save-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.save-status.show {
    transform: translateX(0);
}

.save-status.saving {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.save-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.save-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading dots animation */
.loading-dots {
    display: inline-flex;
    gap: 2px;
}

.loading-dots .dot {
    width: 4px;
    height: 4px;
    background: #D6DF23;
    border-radius: 50%;
    animation: pulse 1.4s infinite;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Material checkbox loading */
.material-checkbox-loading {
    position: relative;
}

.material-checkbox-loading::after {
    content: '';
    position: absolute;
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 1px solid #f3f3f3;
    border-top: 1px solid #D6DF23;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Button states */
.btn-primary.loading,
.btn-secondary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after,
.btn-secondary.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

.btn-secondary.loading::after {
    border-top-color: #1f1e30;
}