/* Custom Styles for TikTok Business Coupons */

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

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fe2c55, #25f4ee);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #25f4ee, #fe2c55);
}

/* Animation for sticky widget */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* Pause animation on hover */
.animate-bounce-slow:hover {
    animation-play-state: paused;
}

/* FAQ accordion styles */
.faq-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-toggle:hover {
    background-color: #f9fafb;
}

.faq-toggle[aria-expanded="true"] i {
    transform: rotate(45deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-content.show {
    max-height: 500px;
}

/* Gradient text animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Table responsiveness */
@media (max-width: 768px) {
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 12px 8px !important;
    }
}

/* Hero section animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* Pulse animation for live indicator */
@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.pulse-dot {
    animation: pulse-dot 2s infinite;
}

/* Button hover effects */
.btn-glow:hover {
    box-shadow: 0 0 40px rgba(254, 44, 85, 0.5);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Mobile menu animation */
#mobileMenu {
    transition: all 0.3s ease;
}

#mobileMenu.show {
    display: block;
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

/* Selection color */
::selection {
    background-color: #fe2c55;
    color: white;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #25f4ee;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom prose styles */
.prose h2 {
    color: #010101;
    font-weight: 800;
}

.prose h3 {
    color: #010101;
    font-weight: 700;
}

.prose strong {
    color: #010101;
}

.prose a {
    color: #fe2c55;
    text-decoration: none;
}

.prose a:hover {
    text-decoration: underline;
}

/* Fix button styling inside prose */
.prose .not-prose a,
.not-prose a {
    color: white !important;
    text-decoration: none !important;
}

.prose .not-prose a:hover,
.not-prose a:hover {
    text-decoration: none !important;
}

/* CTA button in dark backgrounds */
.bg-tiktok-dark a,
.bg-gradient-to-r a {
    color: white !important;
}

/* Ensure white text on gradient buttons */
a[class*="from-tiktok-pink"] {
    color: white !important;
}

a[class*="from-tiktok-pink"]:hover {
    color: white !important;
    text-decoration: none !important;
}

/* Table striped effect on hover */
table tbody tr:hover {
    background-color: #f9fafb;
}

/* Sticky header shadow on scroll */
header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Mobile bottom padding for sticky CTA */
@media (max-width: 767px) {
    body {
        padding-bottom: 70px;
    }
}

/* Gradient border effect */
.gradient-border {
    position: relative;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(135deg, #fe2c55, #25f4ee);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Text shadow for better readability */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Counter animation */
@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-animation {
    animation: count-up 0.8s ease-out forwards;
}

/* Ripple effect for buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ======================================== */

/* Mobile text sizes */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* Hero section mobile fixes */
    .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .text-5xl {
        font-size: 2rem !important;
    }
    
    .text-6xl {
        font-size: 2.25rem !important;
    }
    
    /* Padding adjustments for mobile */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Card padding on mobile */
    .rounded-2xl,
    .rounded-3xl {
        padding: 1rem !important;
    }
    
    /* Grid gap on mobile */
    .gap-8 {
        gap: 1rem !important;
    }
    
    .gap-12 {
        gap: 1.5rem !important;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
}

/* Mobile table improvements */
@media (max-width: 768px) {
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 12px !important;
    }
    
    table th,
    table td {
        padding: 8px 4px !important;
        white-space: nowrap;
    }
    
    /* Hide some columns on mobile for better UX */
    table th:nth-child(4),
    table td:nth-child(4) {
        display: none;
    }
}

/* Mobile navigation improvements */
@media (max-width: 767px) {
    #mobileMenu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    #mobileMenu:not(.hidden) {
        max-height: 500px;
    }
    
    /* Full width buttons on mobile */
    .rounded-full {
        width: 100%;
        justify-content: center;
    }
    
    /* Stack flex items on mobile */
    .flex-col.sm\:flex-row {
        flex-direction: column !important;
    }
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .faq-toggle {
        padding: 1rem !important;
    }
}

/* Mobile sticky bar improvements */
#mobileStickyBar {
    padding: 0.75rem;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

#mobileStickyBar a {
    font-size: 0.875rem;
    padding: 0.875rem 1rem;
}

/* Better spacing for comparison table on mobile */
@media (max-width: 640px) {
    #comparison table th,
    #comparison table td {
        padding: 6px 3px !important;
        font-size: 11px !important;
    }
    
    #comparison table th:first-child,
    #comparison table td:first-child {
        min-width: 80px;
    }
}

/* Industry cards mobile layout */
@media (max-width: 640px) {
    #use-cases .grid {
        grid-template-columns: 1fr !important;
    }
}

/* GEO section mobile */
@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Credit strategy cards mobile */
@media (max-width: 640px) {
    .border-l-4 {
        border-left-width: 3px;
    }
}

/* Savings calculator mobile */
@media (max-width: 768px) {
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .w-20.h-20 {
        width: 4rem !important;
        height: 4rem !important;
    }
}

/* Footer mobile layout */
@media (max-width: 768px) {
    footer .grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    footer .flex.gap-4 {
        justify-content: center;
    }
}

/* Trust badges mobile */
@media (max-width: 640px) {
    .flex.items-center.gap-6 {
        flex-wrap: wrap;
        gap: 0.75rem !important;
        justify-content: center;
    }
    
    .flex.items-center.gap-6 > div {
        font-size: 0.75rem;
    }
}

/* Stats section mobile */
@media (max-width: 640px) {
    .grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .text-4xl.md\:text-5xl {
        font-size: 1.75rem !important;
    }
}

/* Smooth scroll for iOS */
html {
    -webkit-overflow-scrolling: touch;
}

/* CTA button styling fix - ensure always white text */
.bg-gradient-to-r.from-tiktok-pink,
[class*="from-tiktok-pink"][class*="to-red-500"],
a[class*="bg-gradient-to-r"][class*="from-tiktok-pink"] {
    color: #ffffff !important;
}

.bg-gradient-to-r.from-tiktok-pink *,
[class*="from-tiktok-pink"][class*="to-red-500"] *,
a[class*="bg-gradient-to-r"][class*="from-tiktok-pink"] * {
    color: #ffffff !important;
}

/* Dark background CTA fix */
.not-prose a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.not-prose a:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Better image handling on mobile */
img {
    max-width: 100%;
    height: auto;
}

/* Fix for Safari sticky positioning */
@supports (-webkit-touch-callout: none) {
    header {
        position: -webkit-sticky;
        position: sticky;
    }
}