/**
 * Crawler Management System - Custom Styles
 * 
 * NOTE: We use Tailwind CSS via CDN for most styling.
 * This file contains custom styles that extend Tailwind.
 */

/* ============================================
   Animation Classes
   ============================================ */

/* Pulse animation for status indicators */
@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Spin animation for loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   Monaco Editor Customizations
   ============================================ */

.monaco-editor-container {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Make Monaco responsive */
.monaco-editor-container .monaco-editor {
    position: absolute !important;
}

/* ============================================
   htmx Loading States
   ============================================ */

/* Add loading indicator during htmx requests */
.htmx-request {
    opacity: 0.5;
    transition: opacity 200ms ease-in;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Skeleton loader for htmx content */
.htmx-settling {
    opacity: 0;
}

.htmx-added {
    opacity: 0;
}

/* ============================================
   Form Enhancements
   ============================================ */

/* Better focus states */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* ============================================
   Table Enhancements
   ============================================ */

/* Sticky table headers */
.table-sticky thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

/* Alternating row colors on hover */
.table-hover tbody tr:hover {
    background-color: rgba(243, 244, 246, 0.5);
}

/* ============================================
   Card Hover Effects
   ============================================ */

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Status Badge Colors
   ============================================ */

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

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

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

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

/* ============================================
   Scrollbar Styling
   ============================================ */

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ============================================
   Code Blocks
   ============================================ */

pre {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* ============================================
   Responsive Utilities
   ============================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Mobile-friendly tables */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    nav, footer, .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .shadow {
        box-shadow: none !important;
    }
}
