/* WithholdRight — Custom Styles
   Layered on top of Tailwind CSS CDN
*/

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

/* Selection color */
::selection { background: rgba(37, 99, 235, 0.18); color: #1e3a8a; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; border: 2px solid #f1f5f9; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Tabular numbers for financial data */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #2563eb 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease infinite;
}

/* Glass morphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(11, 18, 32, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.revealed { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* Count-up animation */
.count-up { display: inline-block; }

/* Mesh gradient background */
.mesh-bg {
    background-image:
        radial-gradient(at 20% 20%, rgba(37, 99, 235, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 10%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 80%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
}

/* Grid background */
.grid-bg {
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* Animated underline */
.link-underline {
    background-image: linear-gradient(transparent calc(100% - 2px), currentColor 2px);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}
.link-underline:hover { background-size: 100% 100%; }

/* Card hover lift */
.card-lift { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease; }
.card-lift:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12); }

/* Shimmer effect for loading */
.shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 1000px 100%;
    animation: shimmer 2.5s linear infinite;
}

/* Prose customizations for articles */
.prose-tax { max-width: 72ch; }
.prose-tax h2 { font-family: 'Inter Tight', sans-serif; font-weight: 800; font-size: 1.875rem; margin-top: 2.5rem; margin-bottom: 1rem; color: #0b1220; letter-spacing: -0.02em; }
.prose-tax h3 { font-family: 'Inter Tight', sans-serif; font-weight: 700; font-size: 1.375rem; margin-top: 2rem; margin-bottom: 0.75rem; color: #101a31; }
.prose-tax p { margin-bottom: 1.25rem; line-height: 1.75; color: #1f2937; }
.prose-tax ul, .prose-tax ol { margin: 1.25rem 0; padding-left: 1.5rem; }
.prose-tax ul li { list-style: disc; margin-bottom: 0.5rem; line-height: 1.7; color: #1f2937; }
.prose-tax ol li { list-style: decimal; margin-bottom: 0.5rem; line-height: 1.7; color: #1f2937; }
.prose-tax blockquote { border-left: 4px solid #2563eb; padding-left: 1rem; margin: 1.5rem 0; color: #4b5563; font-style: italic; }
.prose-tax strong { color: #0b1220; font-weight: 700; }
.prose-tax a { color: #2563eb; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose-tax table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; }
.prose-tax table th { background: #f1f5f9; padding: 0.75rem 1rem; text-align: left; font-weight: 700; color: #0b1220; border-bottom: 2px solid #e2e8f0; font-size: 0.875rem; }
.prose-tax table td { padding: 0.75rem 1rem; border-bottom: 1px solid #e2e8f0; font-size: 0.9375rem; }
.prose-tax code { background: #f1f5f9; padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.875em; font-family: 'JetBrains Mono', monospace; }

/* Calculator inputs */
.calc-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}
.calc-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Result card */
.result-card {
    background: linear-gradient(135deg, #0b1220 0%, #1a2541 100%);
    color: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

/* Floating labels */
.float-label {
    position: relative;
}
.float-label label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: all 0.2s;
    pointer-events: none;
    font-size: 1rem;
}
.float-label input:focus + label,
.float-label input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    background: white;
    padding: 0 0.4rem;
    color: #2563eb;
    font-weight: 600;
}

/* Animated gradient border */
.gradient-border {
    position: relative;
    background: white;
    border-radius: 1rem;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #2563eb, #7c3aed, #10b981);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}
.gradient-border:hover::before { opacity: 1; }

/* Loading spinner */
.spinner {
    border: 3px solid #f1f5f9;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Hide number input arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Print friendly */
@media print {
    header, footer, .no-print { display: none !important; }
    body { color: black; }
}
