/* Custom styles for Easy CRM */

/* Upload area drag and drop styles */
.upload-dragover {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
}

/* Table row hover effects */
.leads-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Sort indicators */
.sort-asc .fa-sort:before {
    content: "\f0de";
}

.sort-desc .fa-sort:before {
    content: "\f0dd";
}

/* Chat message animations */
.chat-message {
    animation: slideIn 0.3s ease-out;
}

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

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

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

/* Progress bar animation */
.progress-bar-animated {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position-x: 1rem;
    }
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Chat widget animations */
.chat-widget-enter {
    animation: chatSlideIn 0.3s ease-out;
}

.chat-widget-exit {
    animation: chatSlideOut 0.3s ease-in;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chatSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* Responsive table */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem;
    }
    
    /* Hide less important columns on mobile */
    .table-responsive th:nth-child(3),
    .table-responsive td:nth-child(3) {
        display: none; /* Hide title column */
    }
    
    .table-responsive th:nth-child(6),
    .table-responsive td:nth-child(6) {
        display: none; /* Hide phone column */
    }
}

@media (max-width: 1024px) {
    /* Adjust filter grid for smaller screens */
    .filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Status indicators */
.status-success {
    background-color: #d1fae5;
    color: #065f46;
}

.status-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Custom scrollbar for chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #374151;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Focus styles for accessibility */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-full-width {
        width: 100% !important;
    }
}

/* Processing Status Indicator Styles */
#processing-status-indicator {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    backdrop-filter: blur(4px);
}

#processing-status-indicator.status-entering {
    opacity: 0;
    transform: translateY(-20px);
}

#processing-status-indicator.status-entered {
    opacity: 1;
    transform: translateY(0);
}

#processing-status-indicator.status-exiting {
    opacity: 0;
    transform: translateY(-20px);
}

/* Progress bar animations */
#progress-bar {
    transition: width 0.5s ease-out, background-color 0.3s ease-out;
}

/* Status icon animations */
.fa-pulse {
    animation: fa-pulse 2s infinite;
}

@keyframes fa-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
    }
}

/* Status indicator responsive design */
@media (max-width: 768px) {
    #processing-status-indicator {
        position: fixed;
        top: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
        width: auto;
    }
}

/* Status message animations */
#status-message {
    transition: opacity 0.2s ease-out;
}

/* Action button styles */
#cancel-processing {
    transition: color 0.2s ease-out;
}

#cancel-processing:hover {
    text-decoration: underline;
}

#status-close {
    transition: color 0.2s ease-out;
}

/* Progress percentage animation */
#progress-percentage {
    transition: opacity 0.2s ease-out;
}

/* Estimated time fade in/out */
#estimated-time {
    transition: opacity 0.3s ease-out;
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}