/* UI Enhancements CSS for StaffifyAI Mailing System */

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2a2a2a;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
}

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

.toast i {
    font-size: 20px;
}

.toast-success {
    background: linear-gradient(135deg, #ff7a1c 0%, #ff9a4c 100%);
    border-left: 4px solid #e66a0c;
}

.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    border-left: 4px solid #c82333;
}

.toast-warning {
    background: linear-gradient(135deg, #ff7a1c 0%, #ffb86c 100%);
    border-left: 4px solid #e66a0c;
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #ff7a1c 0%, #ff9a4c 100%);
    border-left: 4px solid #e66a0c;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 122, 28, 0.2);
    border-top-color: #ff7a1c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    color: white;
    font-size: 16px;
    margin: 0;
}

/* Button Loading State */
.btn i.fa-spinner {
    margin-right: 8px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    color: #444;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    color: #ddd;
    font-size: 24px;
    margin-bottom: 12px;
}

.empty-state-message {
    color: #999;
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
}

/* Skeleton Loaders */
.skeleton-table {
    width: 100%;
}

.skeleton-row {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #333;
}

.skeleton-cell {
    height: 20px;
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    flex: 1;
}

.skeleton-card {
    padding: 20px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 16px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    background: linear-gradient(90deg, #333 25%, #3a3a3a 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 16px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    background: linear-gradient(90deg, #333 25%, #3a3a3a 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

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

/* Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    animation: fadeIn 0.2s;
}

.confirm-modal.active {
    display: flex;
}

.confirm-content {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 12px;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

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

.confirm-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.confirm-warning .confirm-icon {
    color: #ff7a1c;
}

.confirm-danger .confirm-icon {
    color: #dc3545;
}

.confirm-content h3 {
    color: white;
    margin-bottom: 12px;
    font-size: 22px;
}

.confirm-content p {
    color: #999;
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 100px;
}

/* Form Validation */
input.error, textarea.error, select.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Hover Effects */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 122, 28, 0.1);
    transition: all 0.2s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(255, 122, 28, 0.2);
    color: #ff7a1c;
    border: 1px solid #ff7a1c;
}

.status-pending {
    background: rgba(255, 122, 28, 0.2);
    color: #ff7a1c;
    border: 1px solid #ff7a1c;
}

.status-inactive {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.status-failed {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

/* Click to Copy */
.copy-able {
    cursor: pointer;
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.copy-able:hover {
    background: rgba(255, 122, 28, 0.1);
}

.copy-able:hover::after {
    content: 'Click to copy';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 4px;
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7a1c, #ff9a4c);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Better Focus States */
button:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 28, 0.2);
}

/* Disabled State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

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

    .confirm-content {
        margin: 20px;
        max-width: none;
    }

    .confirm-buttons {
        flex-direction: column;
    }

    .confirm-buttons .btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.3s ease;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    margin-bottom: 2px;
}

/* Loading dots animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Pulse animation for new items */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.2s ease;
}

/* Button Colors - Ensure all use orange theme */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #ff7a1c 0%, #ff9a4c 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff9a4c 0%, #ffb86c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 122, 28, 0.3);
}

.btn-secondary {
    background: #444;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #555;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c 0%, #f85555 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}
