/**
 * Component styles
 * Styles for reusable UI components
 */

/* ============================================
   TOAST NOTIFICATIONS - Luma Style
   ============================================ */
.toast-container {
    z-index: 9999 !important;
}

.toast {
    min-width: 350px;
    max-width: 450px;
    margin-bottom: 0.75rem;
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08)) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16) !important;
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem !important;
    border-bottom: none !important;
    background: transparent !important;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
}

.toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.toast-time {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280) !important;
}

.toast-body {
    padding: 0 1rem 1rem 3.5rem !important;
    font-size: 0.875rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.5;
}

/* Toast Types - Luma Style */
.toast.toast-success {
    border-left: 4px solid #10b981 !important;
}

.toast.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.toast.toast-danger,
.toast.toast-error {
    border-left: 4px solid #ef4444 !important;
}

.toast.toast-danger .toast-icon,
.toast.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.toast.toast-warning {
    border-left: 4px solid #f59e0b !important;
}

.toast.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.toast.toast-info {
    border-left: 4px solid #3b82f6 !important;
}

.toast.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Close button */
.toast .btn-close {
    opacity: 0.5;
    padding: 0.25rem;
    transition: opacity 0.2s ease;
}

.toast .btn-close:hover {
    opacity: 1;
}

/* Toast Action Buttons - Luma Style */
.toast .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.toast .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Secondary button (Cancel) */
.toast .btn-secondary {
    background: var(--bg-secondary, #f3f4f6) !important;
    border-color: var(--border-color, rgba(0, 0, 0, 0.1)) !important;
    color: var(--text-primary, #1f2937) !important;
}

.toast .btn-secondary:hover {
    background: var(--bg-tertiary, #e5e7eb) !important;
    border-color: var(--border-color-hover, rgba(0, 0, 0, 0.15)) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Danger button (Confirm) */
.toast .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.toast .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* Success button */
.toast .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.toast .btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* Info button */
.toast .btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.toast .btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Warning button */
.toast .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.toast .btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* Button container in toast */
.toast .d-flex.gap-2 {
    gap: 0.5rem !important;
    margin-top: 0.75rem;
}

/* Toast animations */
.toast.fade-in {
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.fade-out {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.fade-out {
        animation: none;
    }
}

/* Dark mode support */
[data-bs-theme="dark"] .toast {
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .toast:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}

/* ============================================
   USER AVATAR COMPONENT
   ============================================ */

/* User Avatar Component */
.user-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.user-avatar.rounded-circle {
    border-radius: 50%;
}

/* File Upload Component */
.file-upload-loader {
    text-align: center;
    padding: 3rem 0;
}

.file-upload-loader .spinner-border {
    width: 3rem;
    height: 3rem;
}

.file-upload-container #uppy-dashboard-improved {
    display: none;
}

.file-upload-container #uppy-dashboard-improved.initialized {
    display: block;
}

/* Text Truncate - 3 lines */
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 4.5rem; /* 3 lines * 1.5 line-height */
}
