/* Custom styles for Apache Log Viewer */

/* Prevent text overflow in table cells */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Enhanced truncate for URL and User Agent columns */
.truncate-url {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-ua {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Statistics specific truncation */
.truncate-stats {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Drag and drop styles */
.drag-over {
    background-color: #dbeafe !important;
    border-color: #3b82f6 !important;
    transform: scale(1.02);
    transition: all 0.2s ease-in-out;
}

/* Enhanced hover effects for table rows */
tr.hover-effect:hover td {
    background-color: #f0f9ff;
    transition: background-color 0.15s ease-in-out;
}

/* Alpine.js cloak - hide elements until Alpine.js initializes */
[x-cloak] {
    display: none !important;
}

/* Loading animations */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

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

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

/* Responsive table container */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Accessibility improvements */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Button focus states */
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Enhanced status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    transition: all 0.15s ease-in-out;
}

.status-badge:hover {
    transform: scale(1.05);
}

/* Modal backdrop blur effect */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.25);
}

/* Smooth transitions for all interactive elements */
.transition-smooth {
    transition: all 0.15s ease-in-out;
}

/* Progress bar animations */
.progress-bar {
    transition: width 0.3s ease-in-out;
}

/* Filter chip animations */
.filter-chip {
    transition: all 0.2s ease-in-out;
}

.filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* IP flag alignment */
.country-flag {
    display: inline-block;
    margin-right: 0.25rem;
    vertical-align: middle;
}

/* Mobile-first responsive design improvements */
@media (max-width: 640px) {
    .table-container {
        font-size: 0.875rem;
    }
    
    .truncate-url {
        max-width: 150px;
    }
    
    .truncate-ua {
        max-width: 100px;
    }
    
    /* Stack pagination controls on mobile */
    .pagination-mobile {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .table-container {
        overflow: visible;
    }
    
    tr {
        break-inside: avoid;
    }
}