/**
 * Hakobjan Custom CSS
 *
 * Aanvullende stijlen bovenop Tailwind CSS.
 * Bevat animaties, custom componenten en overrides.
 *
 * @package Hakobjan
 */

/* ==========================================================================
   CSS Variabelen
   ========================================================================== */
:root {
    --hk-transition: 300ms ease;
    --hk-shadow-color: 99 102 241;
}

/* ==========================================================================
   Map Dark Mode
   ========================================================================== */
.dark #contact-map {
    filter: invert(1) hue-rotate(180deg) contrast(0.9) brightness(0.85);
    transition: filter 300ms ease;
}

#contact-map {
    transition: filter 300ms ease;
}

/* ==========================================================================
   Globale Stijlen
   ========================================================================== */

/* Voorkom horizontaal scrollen op mobiel */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Voorkom dat lange woorden (bijv. Duits) uit containers overlopen */
h1, h2, h3, h4, h5, h6,
p, li, span, a, td, th, label, blockquote {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Verbeterde woordafbreking voor Duits en andere talen met lange woorden */
:lang(de) h1, :lang(de) h2, :lang(de) h3, :lang(de) h4,
:lang(de) p, :lang(de) li, :lang(de) span, :lang(de) a {
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* Selectie kleur */
::selection {
    background-color: rgba(99, 102, 241, 0.2);
    color: inherit;
}

/* Scrollbar styling (WebKit) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe transparent;
}

.dark * {
    scrollbar-color: #334155 transparent;
}

/* ==========================================================================
   Navigatie
   ========================================================================== */

/* Nav scroll effect */
.hk-nav-scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.dark .hk-nav-scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Animatie Klassen (voor Intersection Observer)
   ========================================================================== */

[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate="fade-in-up"] {
    transform: translateY(30px);
}

[data-animate="fade-in"] {
    transform: none;
}

[data-animate="slide-in-left"] {
    transform: translateX(-30px);
}

[data-animate="slide-in-right"] {
    transform: translateX(30px);
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* Reduce motion voor gebruikers die dat prefereren */
@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   Calculator Stijlen
   ========================================================================== */

/* Calculator card entrance animation */
.calc-card {
    animation: calcCardIn 0.5s ease-out backwards;
}

.calc-card:nth-child(1) { animation-delay: 0s; }
.calc-card:nth-child(2) { animation-delay: 0.08s; }
.calc-card:nth-child(3) { animation-delay: 0.16s; }
.calc-card:nth-child(4) { animation-delay: 0.24s; }
.calc-card:nth-child(5) { animation-delay: 0.32s; }
.calc-card:nth-child(6) { animation-delay: 0.4s; }

@keyframes calcCardIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Geselecteerde calculator optie */
.calc-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-option.selected {
    border-color: #6366f1 !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.04));
    box-shadow: 0 0 0 1px #6366f1, 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.dark .calc-option.selected {
    border-color: #818cf8 !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.1));
    box-shadow: 0 0 0 1px #818cf8, 0 4px 12px rgba(99, 102, 241, 0.2);
}

.calc-option.selected svg {
    color: #6366f1 !important;
}

.dark .calc-option.selected svg {
    color: #818cf8 !important;
}

.calc-option.selected span {
    color: #4338ca;
}

.dark .calc-option.selected span {
    color: #a5b4fc;
}

/* Selected option check mark */
.calc-option.selected::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
    animation: checkPop 0.3s ease-out;
}

.dark .calc-option.selected::after {
    background-color: #818cf8;
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Checkbox gestyled */
.calc-checkbox {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-checkbox input:checked ~ div span:first-child {
    color: #4338ca;
}

.dark .calc-checkbox input:checked ~ div span:first-child {
    color: #a5b4fc;
}

.calc-checkbox:has(input:checked) {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.04));
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.dark .calc-checkbox:has(input:checked) {
    border-color: #818cf8;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.1));
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* Auto-selected animation flash */
.calc-auto-selected {
    animation: autoSelectFlash 0.6s ease-out;
}

@keyframes autoSelectFlash {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Summary items animation */
.calc-summary-item {
    animation: summarySlide 0.3s ease-out backwards;
}

.calc-summary-item:nth-child(1) { animation-delay: 0s; }
.calc-summary-item:nth-child(2) { animation-delay: 0.05s; }
.calc-summary-item:nth-child(3) { animation-delay: 0.1s; }
.calc-summary-item:nth-child(4) { animation-delay: 0.15s; }
.calc-summary-item:nth-child(5) { animation-delay: 0.2s; }
.calc-summary-item:nth-child(6) { animation-delay: 0.25s; }

@keyframes summarySlide {
    0% { opacity: 0; transform: translateX(10px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Prijs animatie */
.price-update {
    animation: priceFlash 0.4s ease-out;
}

/* Promo banner stripes animation */
@keyframes calc-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 95%; }
}

@keyframes priceFlash {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        color: #6366f1;
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   Portfolio Filter
   ========================================================================== */

.portfolio-item {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.portfolio-item.hidden-item {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */

.faq-toggle .faq-icon {
    transition: transform 0.2s ease;
}

.faq-toggle.active .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-content.open {
    max-height: 500px;
}

/* ==========================================================================
   Formulier Focus Stijlen
   ========================================================================== */

input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* Status berichten */
.form-success {
    background-color: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.dark .form-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.form-error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.dark .form-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Laptop keyboard key press animation */
.typewriter-key {
    transition: all 0.08s ease;
    will-change: transform;
}

/* Laptop screen line styling */
.laptop-line {
    white-space: nowrap;
    overflow: hidden;
}

/* Blog card filter transition base */
.blog-card {
    will-change: opacity, transform;
}

/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */

#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ==========================================================================
   Custom Logo WordPress
   ========================================================================== */

.custom-logo-link {
    display: flex;
    align-items: center;
}

.custom-logo {
    height: 40px;
    width: auto;
}

/* ==========================================================================
   WordPress Paginering
   ========================================================================== */

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #6b7280;
    background: #f3f4f6;
}

.dark .nav-links .page-numbers {
    color: #9ca3af;
    background: #1e293b;
}

.nav-links .page-numbers.current {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-links .page-numbers:hover:not(.current) {
    background: #e0e7ff;
    color: #4338ca;
}

.dark .nav-links .page-numbers:hover:not(.current) {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* ==========================================================================
   Responsive Aanpassingen
   ========================================================================== */

@media (max-width: 640px) {
    /* Kleinere hero tekst op mobiel */
    .hero-headline {
        font-size: 2.25rem;
        line-height: 1.2;
    }
}

/* ==========================================================================
   Pricing Hero Animations
   ========================================================================== */

/* Orbiting tech icons */
@keyframes orbitSlow {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes counterSpin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Animated bar growth */
@keyframes barGrow1 {
    0%, 100% { height: 40%; }
    50%      { height: 80%; }
}
@keyframes barGrow2 {
    0%, 100% { height: 70%; }
    50%      { height: 45%; }
}
@keyframes barGrow3 {
    0%, 100% { height: 55%; }
    50%      { height: 95%; }
}

/* Sparkle effect */
@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    25%      { transform: scale(1.2) rotate(10deg); opacity: 0.8; }
    50%      { transform: scale(0.9) rotate(-5deg); opacity: 1; }
    75%      { transform: scale(1.15) rotate(5deg); opacity: 0.9; }
}

/* Checkmark bounce */
@keyframes checkBounce {
    0%, 100% { transform: scale(1); }
    30%      { transform: scale(1.15); }
    60%      { transform: scale(0.95); }
}

/* Floating particles */
@keyframes particleFloat {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.4; }
    25%      { transform: translateY(-15px) translateX(8px) scale(1.3); opacity: 0.8; }
    50%      { transform: translateY(-25px) translateX(-5px) scale(0.8); opacity: 0.5; }
    75%      { transform: translateY(-10px) translateX(12px) scale(1.1); opacity: 0.7; }
}

/* Dashed line flow */
@keyframes dashFlow {
    0%   { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -20; }
}

/* Pricing counter animation */
.pricing-counter {
    font-variant-numeric: tabular-nums;
}

/* ─── Blog Post Styles ─── */
#reading-progress {
    transform-origin: left;
    will-change: width;
}

.prose-content p {
    margin-bottom: 1rem;
}

.prose-content a {
    color: rgb(var(--color-primary-600));
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dark .prose-content a {
    color: rgb(var(--color-primary-400));
}

.prose-content strong {
    font-weight: 700;
    color: #111827;
}

.dark .prose-content strong {
    color: #f9fafb;
}

/* Smooth code block scrollbar */
pre::-webkit-scrollbar {
    height: 6px;
}
pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
pre::-webkit-scrollbar-track {
    background: transparent;
}

/* ─── FAQ Floating Question Marks ─── */
@keyframes faqFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(-12px) rotate(5deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-6px) rotate(-3deg);
        opacity: 1;
    }
    75% {
        transform: translateY(-18px) rotate(4deg);
        opacity: 0.7;
    }
}

/* ==========================================================================
   Quote Success Overlay Animations
   ========================================================================== */

@keyframes bounce-once {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: scale(1.15); opacity: 1; }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes ping-slow {
    0%   { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(2.2); opacity: 0; }
}

@keyframes check-draw {
    to { stroke-dashoffset: 0; }
}

.animate-bounce-once {
    animation: bounce-once 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-ping-slow {
    animation: ping-slow 1.5s cubic-bezier(0, 0, 0.2, 1) 0.4s infinite;
}

.animate-check-draw {
    animation: check-draw 0.5s ease 0.4s forwards;
}

/* ==========================================================================
   Prism.js Overrides – match existing code block styling
   ========================================================================== */
pre[class*="language-"],
code[class*="language-"] {
    background: transparent !important;
    text-shadow: none !important;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

pre[class*="language-"] {
    margin: 0 !important;
    padding: 1.5rem !important;
    border-radius: 0 !important;
}

/* Token color adjustments for better contrast on dark bg */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6b7280 !important;
}

.token.punctuation {
    color: #d1d5db !important;
}
