@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom CSS variables */
:root {
    /* Backgrounds */
    --bg-primary: #F0ECE0;
    --bg-secondary: #FFFFFF;
    --bg-accent: #EE4D87;
    
    /* Text colors */
    --text-header: #000151;
    --text-body: #292929;
    
    /* Button colors */
    --button-primary: #000151;
    --button-accent: #EE4D87;
}

/* Tab hover styles */
.tab:hover {
    color: var(--button-accent);
}

.limited-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Background utilities */
.bg-primary {
    background-color: var(--bg-primary);
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

/* Text utilities */
.text-header {
    color: var(--text-header);
}

.text-body {
    color: var(--text-body);
}

/* Button utilities */
.bg-button-primary {
    background-color: var(--button-primary);
}

.hover\:bg-button-accent:hover {
    background-color: var(--button-accent);
}

/* Badge utilities */
.badge-accent {
    background-color: var(--button-accent);
    color: white;
}

/* Share button hover styles */
.share-button svg {
    color: #6B7280; /* gray-500 */
    transition: color 0.2s ease-in-out;
}

.share-button:hover svg {
    color: #374151; /* gray-700 */
}

/* Share button animation */
.share-button {
    transition: all 0.2s ease;
}

.share-button:active {
    transform: scale(0.95);
    background-color: #E5E7EB;
}

.share-button svg {
    transition: all 0.3s ease;
}

.share-button:active svg {
    animation: pulse-scale 0.3s ease;
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Checkmark animation for copy confirmation */
@keyframes checkmark-draw {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.share-button .checkmark {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.share-button.copied .checkmark {
    animation: checkmark-draw 0.4s ease forwards;
}

/* Fade-in animation for tooltip */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -100%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -100%) translateY(0);
    }
}

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

/* New arrival badge tooltip */
.new-arrival-badge-wrapper {
    position: relative;
    display: inline-block;
}

.new-arrival-badge-wrapper:hover .new-arrival-tooltip {
    display: block;
}

/* Hide scrollbar for tab bar on mobile */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* Mobile two-column grid */
@media (max-width: 767px) {
    #deals-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    #deals-container > div {
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    /* Simplified mobile card */
    .mobile-deal-card .deal-image-container {
        padding: 0;
        margin: 0;
    }
    
    .mobile-deal-card img {
        border-radius: 0.5rem 0.5rem 0 0;
    }
    
    .mobile-deal-card .deal-content {
        padding: 0.5rem;
    }
    
    .mobile-deal-card h5 {
        font-size: 0.875rem;
        line-height: 1.2;
        margin: 0 0 0.25rem 0;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .mobile-deal-card .price-info {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .mobile-deal-card .avg-price {
        font-size: 0.75rem;
    }
    
    /* Hide elements on mobile */
    .mobile-deal-card .buy-button,
    .mobile-deal-card .share-button,
    .mobile-deal-card .deal-details-toggle,
    .mobile-deal-card hr {
        display: none !important;
    }
    
    /* Adjust badge sizes for mobile */
    .mobile-deal-card .badge {
        font-size: 0.7rem;
        padding: 0.125rem 0.375rem;
    }
    
    /* Scale down deal score badge on mobile */
    .mobile-deal-card .deal-score-badge {
        transform: scale(0.8);
        transform-origin: top right;
    }
}