/* Site Catalogue COMC - Custom Styles */

/* Base styles - Complement Tailwind */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #64748b;
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* HTMX loading indicator */
.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-indicator {
    display: none;
}

/* Product card hover effect */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Image zoom on hover */
.product-image-container {
    overflow: hidden;
}

.product-image-container img {
    transition: transform 0.3s ease;
}

.product-image-container:hover img {
    transform: scale(1.05);
}

/* Flash messages animation */
.flash-message {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Form focus states */
input:focus, select:focus, textarea:focus {
    outline: none;
    ring: 2px solid var(--color-primary);
    border-color: var(--color-primary);
}

/* Button animations */
button, .btn {
    transition: all 0.2s ease;
}

button:active, .btn:active {
    transform: scale(0.98);
}

/* Disabled state */
button:disabled, .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cart badge animation */
.cart-badge {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Pagination styles */
.pagination-link {
    transition: background-color 0.2s ease;
}

.pagination-link:hover {
    background-color: #f1f5f9;
}

.pagination-link.active {
    background-color: var(--color-primary);
    color: white;
}

/* Sticky header shadow on scroll */
.header-scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile menu transition */
.mobile-menu {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .hide-mobile {
        display: none;
    }
}

@media (min-width: 641px) {
    .hide-desktop {
        display: none;
    }
}
