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

@layer base {
    html {
        scroll-behavior: smooth;
    }
    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

@layer components {
    /* Gradient Button */
    .gradient-btn {
        background: linear-gradient(135deg, #7331ff 0%, #8B5CF6 50%, #A855F7 100%);
        @apply text-white font-semibold py-3 px-6 rounded-xl shadow-lg transition-all duration-300 hover:shadow-xl;
    }
    .gradient-btn:hover {
        background: linear-gradient(135deg, #5a25dd 0%, #7c3aed 50%, #9333ea 100%);
        transform: scale(1.02);
    }

    /* Primary Gradient Background */
    .gradient-from-primary {
        background: linear-gradient(135deg, #7331ff 0%, #8B5CF6 50%, #A855F7 100%);
    }

    /* Hero gradient background */
    .gradient-bg-hero {
        background: linear-gradient(135deg, rgba(115, 49, 255, 0.08) 0%, rgba(168, 85, 247, 0.12) 40%, rgba(115, 49, 255, 0.05) 100%);
    }

    /* Section gradient background */
    .gradient-bg-section {
        background: linear-gradient(180deg, rgba(115, 49, 255, 0.03) 0%, rgba(168, 85, 247, 0.06) 100%);
    }

    /* Gradient text */
    .gradient-text {
        background: linear-gradient(135deg, #7331ff 0%, #8B5CF6 50%, #A855F7 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* Feature card hover effect */
    .feature-card {
        background: white;
        border-radius: 1rem;
        padding: 1.5rem;
        border: 1px solid #e5e7eb;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    .feature-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #7331ff, #A855F7);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .feature-card:hover {
        box-shadow: 0 20px 40px -12px rgba(115, 49, 255, 0.15);
        border-color: rgba(115, 49, 255, 0.2);
        transform: translateY(-4px);
    }
    .feature-card:hover::before {
        opacity: 1;
    }

    /* Feature icon styling */
    .feature-icon {
        width: 3.5rem;
        height: 3.5rem;
        border-radius: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        margin-bottom: 1rem;
        background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
        box-shadow: 0 8px 16px -4px rgba(115, 49, 255, 0.3);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .feature-card:hover .feature-icon {
        transform: scale(1.1);
        box-shadow: 0 12px 24px -4px rgba(115, 49, 255, 0.4);
    }

    @media (min-width: 1024px) {
        .feature-card {
            padding: 2rem;
        }
        .feature-icon {
            width: 4rem;
            height: 4rem;
            font-size: 1.875rem;
            margin-bottom: 1.5rem;
        }
    }

    /* Process step number */
    .process-number {
        @apply w-12 h-12 lg:w-16 lg:h-16 rounded-full flex items-center justify-center text-white font-bold text-lg lg:text-xl;
        background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
        box-shadow: 0 8px 16px -4px rgba(115, 49, 255, 0.3);
    }

    /* Navigation link */
    .nav-link {
        @apply relative text-gray-600 hover:text-primary transition-all duration-200 px-4 py-2 rounded-lg;
    }
    .nav-link::after {
        @apply content-[''] absolute bottom-0 left-1/2 w-0 h-0.5 bg-primary transition-all duration-300 -translate-x-1/2;
    }
    .nav-link:hover::after {
        @apply w-full;
    }

    /* Primary button (legacy) */
    .btn-primary {
        @apply gradient-btn;
    }

    /* Secondary button */
    .btn-secondary {
        @apply bg-white border-2 border-gray-200 text-gray-700 font-semibold py-3 px-6 rounded-xl transition-all duration-300 hover:border-primary hover:text-primary;
    }

    /* Card hover effect */
    .card-hover {
        @apply transition-all duration-300;
    }
    .card-hover:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 40px -12px rgba(115, 49, 255, 0.15);
    }

    /* Connector line for process steps */
    .connector-line {
        background: linear-gradient(90deg, #7331ff 0%, #A855F7 100%);
        @apply h-0.5 w-12 lg:w-16 self-start mt-8;
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 50;
    background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
    border: none;
    cursor: pointer;
}
.back-to-top:hover {
    transform: scale(1.1);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: white;
    z-index: 40;
    padding-top: 80px;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 32px;
    overflow-y: auto;
}
.mobile-menu.active {
    display: block;
}

/* Tab styles */
.tab-btn {
    padding: 12px 20px;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 18px;
}
.tab-btn:hover {
    color: #7331ff;
}
.tab-btn.active {
    color: #7331ff;
    border-color: #7331ff;
}

/* FAQ card style */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.faq-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}
.faq-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border-color: rgba(115, 49, 255, 0.2);
}
.faq-card-question {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1f2937;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
}
.faq-card-question::before {
    content: 'Q';
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.faq-card-answer {
    color: #6b7280;
    line-height: 1.625;
    padding-left: 40px;
}

/* Comparison table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}
.comparison-table thead tr {
    background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
}
.comparison-table th {
    padding: 20px 24px;
    text-align: left;
    color: white;
    font-weight: 700;
}
.comparison-table td {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}
.comparison-table tbody tr {
    transition: background-color 0.2s ease;
}
.comparison-table tbody tr:hover {
    background-color: rgba(168, 85, 247, 0.1);
}

/* Counter animation */
.counter {
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 700;
    color: #7331ff;
}
@media (min-width: 1024px) {
    .counter {
        font-size: 3rem;
        line-height: 1;
    }
}

/* Case card */
.case-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}
.case-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(115, 49, 255, 0.15);
}
.case-card-img {
    width: 100%;
    height: 192px;
    background-size: cover;
    background-position: center;
}
@media (min-width: 1024px) {
    .case-card-img {
        height: 208px;
    }
}

/* Testimonial card */
.testimonial-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    height: 100%;
}
.testimonial-slide {
    display: flex;
}
@media (min-width: 1024px) {
    .testimonial-card {
        padding: 32px;
    }
}

/* Blog card */
.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    display: block;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(115, 49, 255, 0.15);
}
.blog-card-img {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
}
@media (min-width: 1024px) {
    .blog-card-img {
        height: 192px;
    }
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-left: 32px;
    padding-bottom: 40px;
    border-left: 2px solid #d1d5db;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 9999px;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
    box-shadow: 0 0 0 4px rgba(115, 49, 255, 0.1);
}

/* Process step */
.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Section label style */
.section-label {
    display: inline-block;
    color: #7331ff;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* Filter button */
.filter-btn {
    padding: 10px 20px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.filter-btn.active {
    background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.filter-btn:not(.active) {
    background: #f3f4f6;
    color: #374151;
}
.filter-btn:not(.active):hover {
    background: #e5e7eb;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

.cursor-blink {
    animation: blink 1s infinite;
}

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

.animate-pulse-slow {
    animation: pulse 2s ease-in-out infinite;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7331ff, #A855F7);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a25dd, #8b3fc9);
}

/* Hover scale effect */
.hover-scale {
    transition: transform 0.3s ease;
}
.hover-scale:hover {
    transform: scale(1.05);
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -12px rgba(115, 49, 255, 0.2);
}

/* Text gradient hover */
.gradient-text-hover {
    background: linear-gradient(135deg, #7331ff 0%, #A855F7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}
.gradient-text-hover:hover {
    background: linear-gradient(135deg, #5a25dd 0%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Shimmer effect for loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}
.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}
.ripple:active::after {
    animation: ripple-effect 0.6s ease-out;
}
@keyframes ripple-effect {
    0% {
        transform: scale(0) translate(-50%, -50%);
        opacity: 1;
    }
    100% {
        transform: scale(100) translate(-50%, -50%);
        opacity: 0;
    }
}

/* Gradient border */
.gradient-border {
    position: relative;
    background: white;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(135deg, #7331ff, #A855F7);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
}

/* Glow effect */
.glow {
    box-shadow: 0 0 20px rgba(115, 49, 255, 0.3);
    transition: box-shadow 0.3s ease;
}
.glow:hover {
    box-shadow: 0 0 40px rgba(115, 49, 255, 0.5);
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-bounce-slow {
    animation: bounce 2s ease-in-out infinite;
}

/* Spin animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-slow {
    animation: spin 3s linear infinite;
}

/* Slide in animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Page transition */
.page-transition {
    animation: pageIn 0.4s ease-out forwards;
}
@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #7331ff, 0 0 0 4px white;
}

/* Selection color */
::selection {
    background: rgba(115, 49, 255, 0.2);
    color: #7331ff;
}
