/* ============================================================
   CodeZerra Templates - Main Stylesheet
   ============================================================ */

@layer base {
    html {
        scroll-behavior: smooth;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    body {
        font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    }
}

@layer components {
    .animate-fade-in {
        animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .template-card {
        @apply bg-white rounded-2xl border border-gray-200 overflow-hidden hover:shadow-xl hover:shadow-gray-200/50 hover:border-primary/20 transition-all duration-300 group;
    }
    
    .template-card:hover .template-preview {
        @apply scale-105;
    }
    
    .btn-primary {
        @apply inline-flex items-center justify-center gap-2 bg-primary hover:bg-indigo-600 text-white px-5 py-2.5 rounded-xl font-medium transition-all shadow-sm shadow-primary/20 hover:shadow-md hover:shadow-primary/30 active:scale-95;
    }
    
    .btn-secondary {
        @apply inline-flex items-center justify-center gap-2 bg-white hover:bg-gray-50 text-gray-700 border border-gray-200 px-5 py-2.5 rounded-xl font-medium transition-all hover:border-gray-300 active:scale-95;
    }
    
    .search-input {
        @apply w-full pl-11 pr-4 py-3.5 bg-white border border-gray-200 rounded-xl text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all;
    }
    
    .category-pill {
        @apply px-4 py-2 rounded-full text-sm font-medium transition-all cursor-pointer select-none border whitespace-nowrap;
    }
    
    .category-pill.active {
        @apply bg-primary text-white border-primary shadow-sm shadow-primary/20;
    }
    
    .category-pill:not(.active) {
        @apply bg-white text-gray-600 border-gray-200 hover:border-gray-300 hover:bg-gray-50;
    }
}

@layer utilities {
    .text-gradient {
        @apply bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary;
    }
    
    .line-clamp-2 {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        /* Standard property for compatibility */
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .scrollbar-hide {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-12px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid #f8fafc;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Selection color */
::selection {
    background-color: #4F46E5;
    color: white;
}