html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kufam', sans-serif;
    background-color: #FFF9F0;
    transition: background-color 0.3s ease;
}

.bg-primary {
    background-color: #FFF9F0;
}

.dark body {
    background-color: #0F1115;
    color: #E2E8F0;
}

.dark .bg-primary,
.dark .bg-primary-dark {
    background-color: #1A1D23;
}

.dark .bg-white {
    background-color: #1A1D23;
}

.dark .text-black {
    color: #E2E8F0;
}

.dark .text-neutral-800,
.dark .text-gray-600,
.dark .text-gray-700,
.dark .text-gray-500,
.dark .text-gray-400 {
    color: #94A3B8;
}

.dark .border-black,
.dark .border-neo,
.dark .border-neo-t,
.dark .border-neo-b {
    border-color: #2D333D;
}

.dark .shadow-neo,
.dark .shadow-neo-sm,
.dark .shadow-neo-lg,
.dark .shadow-neo-xl {
    box-shadow: 4px 4px 0px 0px #2D333D;
}

html[dir="rtl"].dark .shadow-neo,
html[dir="rtl"].dark .shadow-neo-sm,
html[dir="rtl"].dark .shadow-neo-lg,
html[dir="rtl"].dark .shadow-neo-xl {
    box-shadow: -4px 4px 0px 0px #2D333D;
}

.dark .shadow-neo-sm {
    box-shadow: 2px 2px 0px 0px #2D333D;
}

.dark .shadow-neo-lg {
    box-shadow: 8px 8px 0px 0px #2D333D;
}

.dark .shadow-neo-xl {
    box-shadow: 12px 12px 0px 0px #2D333D;
}

.dark #mobile-menu {
    background-color: #0F1115;
}

.dark .nav-underline::after {
    filter: brightness(1.5) hue-rotate(180deg);
}

.dark .bg-black {
    background-color: #1A1D23;
    border: 2px solid #2D333D;
}

/* Dark Mode Text Color Overrides for elements on light backgrounds */
.dark [data-t="hero_badge"],
.dark .marquee-item span,
.dark .marquee-item i,
.dark #features h2,
.dark #features p,
.dark #how-it-works i,
.dark #jump-up i {
    color: #FFF9F0 !important;
}

/* Ensure icons in how-it-works circles stay light */
.dark #how-it-works .bg-secondary i {
    color: #1e3a5f !important;
}

/* Dark Mode Text Color Overrides */
.dark [data-t="hero_badge"],
.dark .marquee-item span,
.dark .marquee-item i,
.dark #features h2,
.dark #features p,
.dark #how-it-works i,
.dark #jump-up i {
    color: #FFF9F0 !important;
}

.dark #features .bg-primary h3,
.dark #features .bg-primary p {
    color: #E2E8F0 !important;
}

.dark #how-it-works h3,
.dark #how-it-works p {
    color: #E2E8F0 !important;
}

/* Illustrative Mode Toggle Refined */
.mode-toggle-hero {
    width: 84px;
    height: 48px;
    background: #d4a574;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 3px solid #1e3a5f;
    box-shadow: 4px 4px 0px #1e3a5f;
}

.dark .mode-toggle-hero {
    background: #1e3a5f;
    border-color: #d4a574;
    box-shadow: 4px 4px 0px #d4a574;
}

.mode-toggle-hero .sky-elements {
    position: absolute;
    inset: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-toggle-hero .cloud {
    position: absolute;
    bottom: 2px;
    right: 8px;
    color: white;
    font-size: 24px;
    transition: opacity 0.5s, transform 0.5s;
}

.dark .mode-toggle-hero .cloud {
    opacity: 0;
    transform: translateY(20px);
}

.mode-toggle-hero .stars {
    position: absolute;
    top: 8px;
    left: 8px;
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    transform: translateY(-20px);
}

.dark .mode-toggle-hero .stars {
    opacity: 1;
    transform: translateY(0);
}

.mode-toggle-knob {
    width: 36px;
    height: 36px;
    background: #1e3a5f;
    border-radius: 8px;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(30, 58, 95, 0.4);
}

.dark .mode-toggle-knob {
    transform: translateX(36px);
    background: #d4a574;
    box-shadow: 0 0 15px rgba(212, 165, 116, 0.4);
}

.mode-toggle-knob .moon-craters {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.5s;
}

.dark .mode-toggle-knob .moon-craters {
    opacity: 1;
}

.mode-toggle-knob .crater {
    position: absolute;
    background: #8B7355;
    border-radius: 50%;
}

.mode-toggle-knob .crater-1 {
    width: 8px;
    height: 8px;
    top: 8px;
    left: 8px;
}

.mode-toggle-knob .crater-2 {
    width: 6px;
    height: 6px;
    bottom: 8px;
    right: 8px;
}

.mode-toggle-knob .crater-3 {
    width: 4px;
    height: 4px;
    top: 20px;
    left: 22px;
}

/* Professional 3D Hero Visual */
.hero-visual-box {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
}

.main-3d-card {
    width: 320px;
    height: 420px;
    background: #FFF;
    border: 4px solid #1e3a5f;
    border-radius: 24px;
    box-shadow: 20px 20px 0px #1e3a5f;
    position: relative;
    z-index: 10;
    transform: rotateY(-15deg) rotateX(10deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.dark .main-3d-card {
    background: #1A1D23;
    border-color: #d4a574;
    box-shadow: 20px 20px 0px #d4a574;
}

.hero-visual-box:hover .main-3d-card {
    transform: rotateY(0deg) rotateX(0deg) scale(1.05);
}

.floating-element {
    position: absolute;
    width: 80px;
    height: 80px;
    background: #d4a574;
    border: 3px solid #1e3a5f;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 8px 8px 0px #1e3a5f;
    z-index: 20;
    transition: all 0.4s ease;
}

.dark .floating-element {
    border-color: #d4a574;
    box-shadow: 8px 8px 0px #d4a574;
    background: #1A1D23;
    color: #d4a574;
}

.furniture-connector {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    stroke: #d4a574;
    stroke-width: 4;
    fill: none;
    filter: drop-shadow(0 0 10px #d4a574);
    opacity: 0;
}

@keyframes furniture-shine-pro {
    0% {
        opacity: 0;
        stroke-dashoffset: 1000;
    }

    10% {
        opacity: 1;
        stroke-dashoffset: 0;
    }

    20% {
        opacity: 0;
    }

    30% {
        opacity: 1;
        stroke-dashoffset: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Language Toggle Refined */
.lang-toggle-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFF9F0;
    /* Primary Color */
    border: 3px solid #1e3a5f;
    border-radius: 12px;
    font-weight: 900;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 4px 0px #1e3a5f;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.dark .lang-toggle-btn {
    background: #1A1D23;
    border-color: #d4a574;
    box-shadow: 4px 4px 0px #d4a574;
    color: #d4a574;
}

.lang-toggle-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #1e3a5f;
    background: #FFF;
}

.dark .lang-toggle-btn:hover {
    box-shadow: 6px 6px 0px #d4a574;
    background: #2D333D;
}

.lang-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-top: 2px solid rgba(255, 255, 255, 0.5);
    border-left: 2px solid rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* Hero Visual - Creative Furniture Display */
.furniture-display {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.display-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    max-height: 500px;
}

.furniture-piece {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.furniture-piece:hover {
    transform: scale(1.1);
    z-index: 10;
}

.piece-icon {
    width: 70px;
    height: 70px;
    background: #FFF9F0;
    border: 3px solid #1e3a5f;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 6px 6px 0 #1e3a5f;
    color: #1e3a5f;
}

.piece-label {
    font-size: 12px;
    font-weight: bold;
    color: #1e3a5f;
    background: #d4a574;
    padding: 4px 12px;
    border-radius: 12px;
    border: 2px solid #1e3a5f;
    white-space: nowrap;
}

/* Main center piece */
.piece-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.piece-center .piece-icon {
    width: 120px;
    height: 120px;
    background: #d4a574;
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.piece-center .piece-label {
    position: absolute;
    bottom: -15px;
    background: #d4a574;
    color: #1e3a5f;
    font-size: 14px;
    padding: 6px 16px;
}

/* Position pieces around center */
.piece-1 { top: 5%; left: 15%; animation: float-1 4s ease-in-out infinite; }
.piece-2 { top: 5%; right: 15%; animation: float-2 4s ease-in-out infinite 0.5s; }
.piece-3 { bottom: 5%; left: 15%; animation: float-3 4s ease-in-out infinite 1s; }
.piece-4 { bottom: 5%; right: 15%; animation: float-4 4s ease-in-out infinite 1.5s; }
.piece-5 { top: 25%; left: 0; animation: float-5 4s ease-in-out infinite 0.3s; }
.piece-6 { top: 25%; right: 0; animation: float-6 4s ease-in-out infinite 0.8s; }
.piece-7 { bottom: 25%; left: 0; animation: float-7 4s ease-in-out infinite 1.3s; }
.piece-8 { bottom: 25%; right: 0; animation: float-8 4s ease-in-out infinite 1.8s; }

@keyframes float-1 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes float-2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-3 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float-4 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }
@keyframes float-5 { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes float-6 { 0%, 100% { transform: translateY(0) rotate(3deg); } 50% { transform: translateY(-9px) rotate(-3deg); } }
@keyframes float-7 { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes float-8 { 0%, 100% { transform: translateY(0) rotate(2deg); } 50% { transform: translateY(-10px) rotate(-2deg); } }

/* Dark mode */
.dark .piece-icon {
    background: #1A1D23;
    border-color: #d4a574;
    box-shadow: 6px 6px 0 #d4a574;
    color: #d4a574;
}

.dark .piece-label {
    background: #1e3a5f;
    color: #d4a574;
    border-color: #d4a574;
}

.dark .piece-center .piece-icon {
    background: #d4a574;
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.dark .piece-center .piece-label {
    background: #d4a574;
    color: #1e3a5f;
}

@media (max-width: 1024px) {
    .display-container {
        max-width: 400px;
        max-height: 400px;
    }
    .piece-icon {
        width: 55px;
        height: 55px;
    }
    .piece-center .piece-icon {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 768px) {
    .display-container {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
    }
    .piece-icon {
        width: 60px;
        height: 60px;
        background: #FFF9F0;
        border: 3px solid #1e3a5f;
        color: #1e3a5f;
    }
    .piece-center .piece-icon {
        width: 100px;
        height: 100px;
        background: #d4a574;
        border-color: #1e3a5f;
        color: #1e3a5f;
    }
    .piece-label {
        font-size: 11px;
        padding: 4px 10px;
    }
    .piece-center .piece-label {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .piece-icon {
        width: 55px;
        height: 55px;
    }
    .piece-center .piece-icon {
        width: 85px;
        height: 85px;
    }
}

/* Marquee Fixes */
.marquee-container {
    width: 100%;
    overflow: hidden;
    background: #d4a574;
    border-top: 2px solid #1e3a5f;
    border-bottom: 2px solid #1e3a5f;
    padding: 1.5rem 0;
}

.marquee-wrapper {
    display: flex;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    flex-shrink: 0;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

html[dir="rtl"] .marquee-wrapper {
    animation: marquee-scroll-rtl 30s linear infinite;
}

@keyframes marquee-scroll-rtl {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

/* FAQ Dark Mode Fix */
.dark details {
    background-color: #1A1D23 !important;
}

.dark details summary {
    color: #E2E8F0;
}

.dark details div {
    color: #94A3B8;
}

/* --- Neo-Brutalism Design System --- */
.border-neo {
    border: 2px solid #1e3a5f;
}

.border-neo-t {
    border-top: 2px solid #1e3a5f;
}

.border-neo-b {
    border-bottom: 2px solid #1e3a5f;
}

.shadow-neo {
    box-shadow: 4px 4px 0px 0px #1e3a5f;
}

.shadow-neo-sm {
    box-shadow: 2px 2px 0px 0px #1e3a5f;
}

.shadow-neo-lg {
    box-shadow: 8px 8px 0px 0px #1e3a5f;
}

.shadow-neo-xl {
    box-shadow: 12px 12px 0px 0px #1e3a5f;
}

.shadow-neo-hover:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px #1e3a5f;
}

.shadow-neo-active:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px 0px #1e3a5f;
}

/* --- Utilities --- */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animations */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 12s linear infinite;
}

@keyframes bounce-slow {

    0%,
    100% {
        transform: translateY(0) rotate(12deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(-6deg);
    }

    50% {
        transform: translateY(-15px) rotate(-8deg);
    }
}

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

@keyframes pulse-slow {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes marquee-rtl {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

.animate-marquee {
    animation: marquee 20s linear infinite;
}

html[dir="rtl"] .animate-marquee {
    animation: marquee-rtl 20s linear infinite;
}

@media (max-width: 768px) {
    .animate-marquee {
        animation: marquee 6s linear infinite;
    }

    html[dir="rtl"] .animate-marquee {
        animation: marquee-rtl 6s linear infinite;
    }
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* Nav Underline */
.nav-underline {
    position: relative;
}

.nav-underline::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='10' viewBox='0 0 40 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 5 Q 10 10 20 5 T 40 5' stroke='%23d4a574' stroke-width='3' fill='none'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 20px 100%;
}

/* Marquee Edge Fades */
.marquee-container {
    position: relative;
}

.marquee-container::before,
.marquee-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, var(--marquee-bg), transparent);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, var(--marquee-bg), transparent);
}

/* Custom Accordion Open State */
details[open] summary~* {
    animation: sweep .5s ease-in-out;
}

@keyframes sweep {
    0% {
        opacity: 0;
        transform: translateY(-10px)
    }

    100% {
        opacity: 1;
        transform: translateY(0)
    }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

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

/* Mobile Menu */
#mobile-menu {
    height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

#mobile-menu.active {
    height: calc(100vh - 80px);
    opacity: 1;
    z-index: 100;
}

.menu-link-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.active .menu-link-item {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for menu items */
#mobile-menu.active .menu-link-item:nth-child(1) {
    transition-delay: 0.1s;
}

#mobile-menu.active .menu-link-item:nth-child(2) {
    transition-delay: 0.15s;
}

#mobile-menu.active .menu-link-item:nth-child(3) {
    transition-delay: 0.2s;
}

#mobile-menu.active .menu-link-item:nth-child(4) {
    transition-delay: 0.25s;
}

#mobile-menu.active .menu-link-item:nth-child(5) {
    transition-delay: 0.3s;
}

.menu-link-item a {
    position: relative;
    display: inline-block;
}

.menu-link-item a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 4px;
    bottom: -2px;
    left: 0;
    background-color: var(--tw-bg-opacity, #d4a574);
    transition: width 0.3s ease;
}

.menu-link-item a:hover::after {
    width: 100%;
}

html[dir="rtl"] .nav-underline::after {
    left: auto;
    right: 0;
}

/* RTL specific adjustments */
html[dir="rtl"] .shadow-neo {
    box-shadow: -4px 4px 0px 0px rgba(30, 58, 95, 1);
}

html[dir="rtl"] .shadow-neo-sm {
    box-shadow: -2px 2px 0px 0px rgba(30, 58, 95, 1);
}

html[dir="rtl"] .shadow-neo-lg {
    box-shadow: -8px 8px 0px 0px rgba(30, 58, 95, 1);
}

html[dir="rtl"] .shadow-neo-xl {
    box-shadow: -12px 12px 0px 0px rgba(30, 58, 95, 1);
}

html[dir="rtl"] .shadow-neo:hover {
    box-shadow: -2px 2px 0px 0px rgba(30, 58, 95, 1);
}

html[dir="rtl"] .shadow-neo-xl:hover {
    box-shadow: -4px 4px 0px 0px rgba(30, 58, 95, 1);
}

/* Fix for absolute positioned elements in RTL */
html[dir="rtl"] .absolute.top-4.left-4 {
    left: auto;
    right: 1rem;
}

html[dir="rtl"] .absolute.bottom-8.left-8 {
    left: auto;
    right: 2rem;
}

html[dir="rtl"] .absolute.-top-4.-right-4 {
    right: auto;
    left: -1rem;
}

html[dir="rtl"] #jump-up {
    left: 2rem;
    right: auto;
}

html[dir="rtl"] [data-t="hero_badge"] {
    transform: rotate(2deg);
}

/* Hero Section RTL Fix - Restore original order, just align container */
html[dir="rtl"] #hero {
    direction: rtl;
}

html[dir="rtl"] #hero>div:last-child {
    justify-content: flex-start;
}

/* Stats Section RTL Fix */
html[dir="rtl"] .absolute.-bottom-10.-right-10 {
    right: auto;
    left: -2.5rem;
}

/* Navbar RTL Fixes */
html[dir="rtl"] .lg\:flex.items-center.gap-10 {
    flex-direction: row;
    /* Ensure it stays row, just reversed by dir */
}

html[dir="rtl"] .lg\:flex.items-center.gap-4 {
    flex-direction: row;
}

/* Jump Up Button */
#jump-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#jump-up.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
