/**
 * UmmahPass UX Enhancements — v2.0
 * Toast notifications, loading states, form validation, micro-interactions
 */

/* Toast Notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 480px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
    border: 1px solid var(--border-light, #E2E8F0);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.toast-success .toast-icon { background: #ECFDF5; color: #059669; }
.toast-error .toast-icon { background: #FEF2F2; color: #DC2626; }
.toast-info .toast-icon { background: #EFF6FF; color: #2563EB; }

.toast-success { border-left: 3px solid #34D399; }
.toast-error { border-left: 3px solid #F87171; }
.toast-info { border-left: 3px solid #60A5FA; }

.toast-message {
    flex: 1;
    color: #1A1A2E;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 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: spinner 0.6s linear infinite;
}

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

/* Button States */
button:disabled,
.btn-gold:disabled,
.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Validation Feedback */
input.valid, textarea.valid, select.valid {
    border-color: #34D399 !important;
}

input.invalid, textarea.invalid, select.invalid {
    border-color: #F87171 !important;
}

.error-message {
    color: #F87171;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Focus States */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--gold, #C9A84C);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Table Row Hover */
table tbody tr {
    transition: background-color 0.1s;
}

table tbody tr:hover {
    background-color: #F8FAFC;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay .spinner-large {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.7s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state h3 {
    color: #1A1A2E;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748B;
    font-size: 0.875rem;
}

/* Mobile Toast */
@media (max-width: 640px) {
    .toast {
        left: 1rem;
        right: 1rem;
        min-width: auto;
        transform: translateY(-120%);
        top: 1rem;
    }

    .toast.show {
        transform: translateY(0);
    }
}
