/* style.css - Complete Native Stylesheet */

/* Global Reset & Base Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc; /* bg-slate-50 */
    color: #1e293b; /* text-slate-800 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout Utilities */
.w-full { width: 100%; }
.w-0 { width: 0; }
.w-6 { width: 1.5rem; }
.w-11 { width: 2.75rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }

.min-h-screen { min-height: 100vh; }
.min-h-\[3\.5rem\] { min-height: 3.5rem; }
.min-h-\[1\.25rem\] { min-height: 1.25rem; }

.max-w-xl { max-width: 36rem; }
.max-w-card { max-width: 420px; width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.top-\[2px\] { top: 2px; }
.left-\[2px\] { left: 2px; }

/* Flexbox */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.self-center { align-self: center; }

.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

/* Grid & Columns */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:p-8 { padding: 2rem; }
    .md\:text-base { font-size: 1rem; }
    .md\:text-5xl { font-size: 3rem; }
    .md\:flex-row { flex-direction: row !important; }
    .md\:text-left { text-align: left !important; }
    .md\:w-\[350px\] { width: 350px !important; }
}

/* Visibility, Pointer & Overflow */
.opacity-0 { opacity: 0; }
.pointer-events-none { pointer-events: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.overflow-x-auto { overflow-x: auto; }
.cursor-pointer { cursor: pointer; }
.select-all { user-select: all; -webkit-user-select: all; }
.hidden { display: none !important; }

/* Word Break & Overflow wrapping for long numbers */
.break-all,
#repeating-display,
#result-display,
#steps-body * {
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

/* Spacing */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }

.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-12 > * + * { margin-top: 3rem; }

/* Colors & Backgrounds */
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-50\/30 { background-color: rgba(248, 250, 252, 0.3); }
.bg-slate-50\/50 { background-color: rgba(248, 250, 252, 0.5); }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-slate-200\/60 { background-color: rgba(226, 232, 240, 0.6); }
.bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6); }
.bg-indigo-50\/50 { background-color: rgba(238, 242, 255, 0.5); }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-white { background-color: #ffffff; }

.text-slate-800 { color: #1e293b; }
.text-slate-700 { color: #334155; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.text-indigo-700 { color: #4338ca; }
.text-indigo-600 { color: #4f46e5; }
.text-indigo-500 { color: #6366f1; }
.text-indigo-400\/80 { color: rgba(129, 140, 248, 0.8); }
.text-rose-500 { color: #f43f5e; }

/* Borders & Shadows */
.border { border: 1px solid #e2e8f0; }
.border-2 { border: 2px solid #e2e8f0; }
.border-b { border-bottom: 1px solid #e2e8f0; }
.border-t { border-top: 1px solid #e2e8f0; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-200\/80 { border-color: rgba(226, 232, 240, 0.8); }
.border-indigo-600 { border-color: #4f46e5; }
.border-b-4 { border-bottom-width: 4px; }
.border-slate-800 { border-color: #1e293b; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-extrabold { font-weight: 800; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }

/* Transitions & Animators */
.transition { transition: all 0.2s ease-in-out; }
.transition-all { transition: all 0.2s ease-in-out; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.transition-opacity { transition-property: opacity; }
.scale-95 { transform: scale(0.95); }

/* Interactive Hover States */
.hover\:bg-slate-50\/50:hover { background-color: rgba(248, 250, 252, 0.5); }
.hover\:bg-slate-50:hover { background-color: #f8fafc; }
.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:bg-slate-200:hover { background-color: #e2e8f0; }
.hover\:text-indigo-700:hover { color: #4338ca; }
.hover\:text-slate-600:hover { color: #475569; }
.hover\:text-slate-800:hover { color: #1e293b; }
.hover\:border-slate-300:hover { border-color: #cbd5e1; }

.focus\:border-indigo-500:focus { border-color: #6366f1; }
.focus\:bg-white:focus { background-color: #ffffff; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5); }
.focus\:ring-4:focus { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
.focus\:ring-indigo-500\/10:focus { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.10); }
.focus\:ring-slate-100:focus { box-shadow: 0 0 0 4px #f1f5f9; }

/* Custom Inputs Styling */
input[type="text"] {
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Remove spin buttons on inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Sibling checked states for sliders */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mixed Number Toggle Switch Styles */
.peer-checked\:bg-indigo-600 {
    position: relative;
    transition: background-color 0.2s ease;
}

.peer-checked\:bg-indigo-600::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    height: 1.25rem; /* h-5 = 20px */
    width: 1.25rem; /* w-5 = 20px */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.peer:checked + .peer-checked\:bg-indigo-600 {
    background-color: #4f46e5;
}

.peer:checked + .peer-checked\:bg-indigo-600::after {
    transform: translateX(1.25rem); /* w-11 minus padding/size */
}

html[dir="rtl"] .peer:checked + .peer-checked\:bg-indigo-600::after {
    transform: translateX(-1.25rem);
}

.peer:checked + .peer-checked\:after\:translate-x-full::after {
    transform: translateX(1.25rem);
}

html[dir="rtl"] .peer:checked + .peer-checked\:after\:translate-x-full::after {
    transform: translateX(-1.25rem);
}

.peer:focus + .peer-focus\:ring-2 {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

/* Mixed Number Slide-In Animation styling */
#whole-container {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#whole-container.active {
    width: 6.5rem; /* w-24 + padding */
    opacity: 1;
    margin-right: 0.5rem;
}

html[dir="rtl"] #whole-container.active {
    margin-right: 0;
    margin-left: 0.5rem;
}

#plus-sign {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#plus-sign.active {
    width: 1.5rem;
    opacity: 1;
    margin-right: 0.5rem;
}

html[dir="rtl"] #plus-sign.active {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Accordion Animations */
#steps-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#steps-content.active {
    max-height: 500px;
}

/* Language Selection Modal Animations */
.backdrop-blur-sm {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#lang-modal {
    transition: opacity 0.30s ease, visibility 0.30s ease;
    visibility: hidden;
}

#lang-modal.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

#lang-modal-card {
    transition: transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.9);
}

#lang-modal.active #lang-modal-card {
    transform: scale(1) !important;
}

.max-h-\[85vh\] {
    max-height: 85vh;
}

/* Link elements */
a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
}

/* Table styles */
table {
    border-collapse: collapse;
    width: 100%;
}
th {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    padding: 0.75rem 1rem;
    text-align: left;
}
html[dir="rtl"] th {
    text-align: right;
}
td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}
tr:last-child td {
    border-bottom: none;
}

/* RTL Overrides */
html[dir="rtl"] .text-left { text-align: right; }
html[dir="rtl"] .text-right { text-align: left; }
html[dir="rtl"] #steps-toggle-btn svg {
    transform: rotate(0);
}
html[dir="rtl"] #steps-toggle-btn.active svg {
    transform: rotate(180deg);
}

/* Premium Navigation Header Styles */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.625rem; /* gap-2.5 */
    font-weight: 700;
    font-size: 1.25rem; /* text-xl */
    color: #1e293b; /* text-slate-800 */
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}
.logo-link:hover {
    color: #4f46e5; /* hover:text-indigo-600 */
}

.logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4f46e5; /* Indigo 600 */
    color: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    width: 2.25rem; /* 36px */
    height: 2.25rem; /* 36px */
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.15), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
    transition: background-color 0.2s ease-in-out;
}
.logo-box:hover {
    background-color: #4338ca; /* Indigo 700 */
}

.nav-btn-outline {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    border: 1px solid #e2e8f0; /* border-slate-200 */
    color: #475569; /* text-slate-600 */
    background-color: #ffffff;
    padding: 0 1rem;
    height: 2.25rem; /* 36px - matches logo-box exactly */
    border-radius: 0.75rem; /* rounded-xl */
    font-weight: 600;
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}
.nav-btn-outline:hover {
    background-color: #f8fafc; /* bg-slate-50 */
    border-color: #cbd5e1; /* border-slate-300 */
    color: #1e293b; /* text-slate-800 */
}

.nav-btn-primary-outline {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    border: 1px solid #e0e7ff; /* indigo-100 */
    color: #4f46e5; /* indigo-600 */
    background-color: #ffffff;
    padding: 0 1rem;
    height: 2.25rem; /* 36px - matches logo-box exactly */
    border-radius: 0.75rem; /* rounded-xl */
    font-weight: 600;
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}
.nav-btn-primary-outline:hover {
    background-color: rgba(238, 242, 255, 0.4); /* Indigo-50/40 */
    border-color: #c7d2fe; /* indigo-200 */
    color: #4338ca; /* indigo-700 */
}

/* Responsive display helper rules */
@media (max-width: 639px) {
    .hidden-xs {
        display: none !important;
    }
    .xs\:w-9 {
        width: 2.25rem !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        justify-content: center !important;
    }
    /* Mobile header space optimizations to prevent text wrapping */
    header {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .header-nav {
        gap: 0.5rem !important;
    }
    .logo-link {
        font-size: 1.125rem !important; /* text-lg */
        gap: 0.5rem !important;
    }
    .nav-btn-outline, .nav-btn-primary-outline {
        padding: 0 0.625rem;
    }
    .xs\:w-9, .sm\:w-9 {
        padding: 0 !important;
    }
}
@media (max-width: 767px) {
    .hidden-sm {
        display: none !important;
    }
    .sm\:w-9 {
        width: 2.25rem !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        justify-content: center !important;
    }
}
