/**
 * Custom CSS - Best-Klin
 * Additional styling beyond Tailwind CSS
 */

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

@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-10px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

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

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

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

/* Selection Color */
::selection {
    background-color: #3b82f6;
    color: white;
}

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

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

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

/* Focus Styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Image Loading */
img {
    transition: opacity 0.3s ease;
}


img.loaded,
img:not([loading="lazy"]) {
    opacity: 1;
}

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem !important;
    }
    h2 {
        font-size: 1.5rem !important;
    }
}

/* Hero Section Background Animation */
.hero-bg-animate {
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* WhatsApp Button Glow */
.wa-glow {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.wa-glow:hover {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
}

/* Testimonial Card */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    color: #e0e7ff;
    font-family: Georgia, serif;
    line-height: 1;
}

/* Editorial article content */
.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #1e3a8a;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 650;
    line-height: 1.4;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content table {
    margin-top: 0.9rem;
    margin-bottom: 0.9rem;
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }

.article-content a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content a:hover { color: #1e40af; }

.article-content strong { color: #1f2937; }

.article-content img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.article-content th,
.article-content td {
    border: 1px solid #dbe3ef;
    padding: 0.7rem;
    text-align: left;
    vertical-align: top;
}

.article-content th {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 700;
}

.article-content blockquote {
    border-left: 4px solid #93c5fd;
    padding-left: 1rem;
    color: #475569;
}

/* Service Card Icon Animation */
.service-icon {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Footer Wave */
.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.footer-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 50px;
}

/* Lazy Load Fade In */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}


/* Keep the floating contact button clear of the desktop banner. */
@media (min-width: 768px) {
    body.bottom-cta-banner-visible .floating-whatsapp-cta {
        bottom: 5rem;
    }
}
