/* Custom styles for Klauner Truck Parts */

/* Root variables for Klauner color scheme */
:root {
    --klauner-gray: #4a5568;
    --klauner-darkgray: #2d3748;
    --klauner-black: #1a202c;
    --klauner-white: #ffffff;
    --klauner-accent: #718096;
    --klauner-light-gray: #e2e8f0;
}

/* Smooth transitions for all interactive elements */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Enhanced card hover effects */
.card:hover {
    transform: translateY(-2px);
    border-color: var(--klauner-accent);
}

/* Product image hover effect */
.card img {
    transition: transform 0.3s ease;
}

.card:hover img {
    transform: scale(1.05);
}

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

::-webkit-scrollbar-track {
    background: var(--klauner-light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--klauner-gray);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--klauner-darkgray);
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: var(--klauner-black);
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--klauner-accent);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--klauner-gray);
}

/* Loading animation for buttons */
.btn:active {
    transform: scale(0.95);
}

/* Badge animations */
.badge {
    animation: fadeIn 0.3s ease-in;
}

.badge-info {
    background-color: #3b82f6;
    color: #ffffff;
}

.badge-info.text-white {
    color: #ffffff !important;
}

.dark .badge-info {
    background-color: #2563eb;
    color: #ffffff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Subtle gradient overlays */
.gradient-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.05));
}

/* Focus styles */
.input:focus,
.btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--klauner-accent);
}

/* Category card hover animation */
.group:hover .group-hover\:scale-110 {
    animation: bounce 0.3s ease-in-out;
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Button Base Styles - Modern, lighter appearance */
.btn {
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Primary Button - Lighter, more modern */
.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white !important;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white !important;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: #cbd5e0;
    border-color: #cbd5e0;
    color: #718096 !important;
    cursor: not-allowed;
}

/* Secondary Button - Light gray */
.btn-secondary {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #475569 !important;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155 !important;
}

.dark .btn-secondary {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db !important;
}

.dark .btn-secondary:hover {
    background-color: #4b5563;
    color: #f9fafb !important;
}

/* Outline Button - Modern borders */
.btn-outline {
    background-color: transparent;
    border: 1px solid #cbd5e1;
    color: #475569 !important;
}

.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #334155 !important;
}

.dark .btn-outline {
    border-color: #4b5563;
    color: #d1d5db !important;
}

.dark .btn-outline:hover {
    background-color: #374151;
    border-color: #6b7280;
    color: #f9fafb !important;
}

/* Ghost Button - Subtle */
.btn-ghost {
    background-color: transparent;
    border-color: transparent;
    color: #64748b !important;
}

.btn-ghost:hover {
    background-color: #f8fafc;
    color: #475569 !important;
}

.dark .btn-ghost {
    color: #9ca3af !important;
}

.dark .btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #d1d5db !important;
}

/* Button Sizes - More compact */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.25rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    gap: 0.5rem;
}

/* Icon styling - ensure proper alignment */
.btn svg {
    color: currentColor;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.btn-sm svg {
    width: 0.875rem;
    height: 0.875rem;
}

.btn-lg svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Fix button text color in dark mode */
.dark .btn-primary {
    color: white !important;
}

.dark .btn-primary:hover {
    color: white !important;
}

/* Success Button Variant */
.btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: white !important;
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

/* Light variant for subtle actions */
.btn-light {
    background-color: #f8fafc;
    border-color: #f1f5f9;
    color: #64748b !important;
}

.btn-light:hover {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569 !important;
    transform: translateY(-1px);
}

.dark .btn-light {
    background-color: #374151;
    border-color: #4b5563;
    color: #9ca3af !important;
}

.dark .btn-light:hover {
    background-color: #4b5563;
    color: #d1d5db !important;
}

/* Professional truck parts aesthetic */
.card {
    border: 1px solid var(--klauner-light-gray);
}

.dark .card {
    border-color: var(--klauner-darkgray);
}

/* Category Page Grid Layout */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Top Sellers Grid - Fixed 3 columns */
.top-sellers-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .top-sellers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Product Card Styles */
.product-card {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.product-card.promoted {
    border: 2px solid var(--klauner-accent);
}

.promoted-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: var(--klauner-accent);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 0.25rem;
    z-index: 10;
}

.price-tag {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--klauner-black);
}

.dark .price-tag {
    color: var(--klauner-white);
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.5rem;
}

.product-card-footer-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-card-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.product-card-cta {
    flex-shrink: 0;
}

@media (max-width: 400px) {
    .listing-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 401px) and (max-width: 640px) {
    .listing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .product-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-card-cta .btn-primary,
    .product-card-cta .btn-outline {
        width: 100%;
    }

    .product-card .price-tag {
        font-size: 1.1rem;
    }
}

/* Filter Styles */
.filter-group {
    border-bottom: 1px solid var(--klauner-light-gray);
    padding-bottom: 1rem;
}

.dark .filter-group {
    border-color: var(--klauner-darkgray);
}

.filter-toggle {
    padding: 0.5rem 0;
}

.filter-toggle:hover {
    color: var(--klauner-accent);
}

.filter-toggle svg {
    transition: transform 0.3s ease;
}

.filter-toggle svg.rotate-180 {
    transform: rotate(180deg);
}

.filter-content {
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.filter-content.hidden {
    max-height: 0;
    overflow: hidden;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--klauner-accent);
}

/* Line clamp for product titles */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category Pills */
.category-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--klauner-light-gray);
    color: var(--klauner-darkgray);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.category-pill:hover {
    background-color: var(--klauner-accent);
    color: white;
}

.dark .category-pill {
    background-color: var(--klauner-darkgray);
    color: var(--klauner-light-gray);
}

.dark .category-pill:hover {
    background-color: var(--klauner-accent);
}

/* Product Page Styles */
.thumbnail-btn {
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.thumbnail-btn.active,
.thumbnail-btn:hover {
    border-color: var(--klauner-accent);
}

.thumbnail-btn img {
    transition: transform 0.3s ease;
}

.thumbnail-btn:hover img {
    transform: scale(1.1);
}

/* Tab Navigation */
.tab-btn {
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: var(--klauner-gray);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.dark .tab-btn {
    color: #9ca3af;
}

.tab-btn:hover {
    color: var(--klauner-black);
    background-color: #f9fafb;
}

.dark .tab-btn:hover {
    color: white;
    background-color: var(--klauner-darkgray);
}

.tab-btn.active {
    color: var(--klauner-black);
    border-bottom-color: var(--klauner-accent);
}

.dark .tab-btn.active {
    color: white;
    border-bottom-color: var(--klauner-accent);
}

/* Specifications Table */
.tab-content table tr:hover {
    background-color: #f9fafb;
}

.dark .tab-content table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Prose styling for descriptions */
.prose {
    color: var(--klauner-gray);
    line-height: 1.75;
}

.dark .prose {
    color: #d1d5db;
}

.prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* Badge enhancements */
.badge {
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

.badge-sm {
    padding: 0.125rem 0.375rem;
    font-size: 0.7rem;
}

.badge-success {
    background-color: #10b981;
    color: white !important;
}

.badge-error {
    background-color: #ef4444;
    color: white !important;
}

.badge-primary {
    background-color: var(--klauner-accent);
    color: white !important;
}

/* Cart count badge */
.cart-count {
    background-color: var(--klauner-accent);
    color: white !important;
    min-width: 1.25rem;
    text-align: center;
}

/* Input field styling */
.input {
    border: 1px solid var(--klauner-light-gray);
    background-color: white;
    color: var(--klauner-black);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.input:focus {
    border-color: var(--klauner-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(113, 128, 150, 0.1);
}

.dark .input {
    background-color: #374151;
    border-color: #4b5563;
    color: white;
}

.dark .input:focus {
    border-color: var(--klauner-accent);
}

/* Select styling */
.select {
    border: 1px solid var(--klauner-light-gray);
    background-color: white;
    color: var(--klauner-black);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.dark .select {
    background-color: #374151;
    border-color: #4b5563;
    color: white;
}

/* Image gallery */
#mainImage {
    transition: opacity 0.3s ease;
}

/* Contact section cards */
.bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.05);
}

.dark .bg-blue-900\/20 {
    background-color: rgba(30, 58, 138, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .thumbnail-btn img {
        height: 4rem;
    }
}

/* Pagination Styles */
.pagination .join {
    display: inline-flex;
    align-items: center;
}

.pagination .join-item {
    border-radius: 0;
    border: 1px solid #e2e8f0;
    margin-left: -1px;
}

.pagination .join-item:first-child {
    border-radius: 0.375rem 0 0 0.375rem;
}

.pagination .join-item:last-child {
    border-radius: 0 0.375rem 0.375rem 0;
}

/* Regular pagination button */
.pagination .btn {
    background-color: white;
    color: #475569 !important;
    border-color: #e2e8f0;
}

.pagination .btn:hover:not(.btn-disabled):not(.btn-active) {
    background-color: #f8fafc;
    color: #334155 !important;
    border-color: #cbd5e1;
}

/* Active page button */
.pagination .btn-active {
    background-color: var(--klauner-accent);
    color: white !important;
    border-color: var(--klauner-accent);
    font-weight: 600;
}

.pagination .btn-active:hover {
    background-color: var(--klauner-darkgray);
    border-color: var(--klauner-darkgray);
}

/* Disabled button */
.pagination .btn-disabled {
    background-color: #f8fafc;
    color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Dark mode pagination */
.dark .pagination .btn {
    background-color: #374151;
    color: #d1d5db !important;
    border-color: #4b5563;
}

.dark .pagination .btn:hover:not(.btn-disabled):not(.btn-active) {
    background-color: #4b5563;
    color: #f3f4f6 !important;
    border-color: #6b7280;
}

.dark .pagination .btn-active {
    background-color: var(--klauner-accent);
    color: white !important;
    border-color: var(--klauner-accent);
}

.dark .pagination .btn-disabled {
    background-color: #1f2937;
    color: #6b7280 !important;
    opacity: 0.7;
}
