/* ClawHub Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

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

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

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

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Category tabs scroll */
#categoryTabs {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#categoryTabs::-webkit-scrollbar {
    display: none;
}

/* Product card animations */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

/* Product bar styles */
.product-bar {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.product-bar:hover {
    border-left-color: #ed7712;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .product-bar:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Keep product icons in original colors in dark mode */
.dark .product-bar img {
    filter: none !important;
    opacity: 1 !important;
}

/* Voting buttons */
.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    min-width: 48px;
    cursor: pointer;
    user-select: none;
}

.vote-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark .vote-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.vote-btn.upvoted {
    color: #10b981;
}

.vote-btn.downvoted {
    color: #ef4444;
}

.vote-btn .vote-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.vote-btn .vote-count {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 2px;
}

/* Type indicator colors */
.type-opensource {
    border-left-color: #10b981 !important;
}

.type-commercial {
    border-left-color: #3b82f6 !important;
}

.type-tool {
    border-left-color: #8b5cf6 !important;
}

/* Tag styles */
.tag {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Install button */
.install-btn {
    transition: all 0.2s ease;
}

.install-btn:hover {
    transform: scale(1.02);
}

/* Status badge pulse animation */
.status-available {
    animation: pulse 2s infinite;
}

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

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

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

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .product-card {
        padding: 0.75rem;
    }

    .product-bar {
        padding: 0.75rem;
    }

    /* Make touch targets larger */
    .category-tab {
        min-height: 36px;
    }

    /* Improve touch scrolling */
    #categoryTabs {
        -webkit-overflow-scrolling: touch;
    }
}

/* Focus styles */
input:focus {
    outline: none;
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(237, 119, 18, 0.5);
}

/* Print styles */
@media print {
    header, footer, #categoryTabs {
        display: none;
    }

    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
