/* ============================================
   SECUFILL CALCULATOR - CUSTOM STYLES
   ============================================
   Main custom CSS for animations, interactions,
   and design refinements beyond Tailwind
   ============================================ */

/* Root Variables */
:root {
    --primary: rgb(14, 165, 233); /* Teal/Blue */
    --primary-dark: rgb(6, 78, 115);
    --accent-orange: rgb(249, 115, 22);
    --accent-green: rgb(34, 197, 94);
    --error: rgb(239, 68, 68);
    --success: rgb(34, 197, 94);
    --dark-bg: rgb(15, 23, 42);
    --dark-card: rgb(30, 41, 59);
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: rgb(51, 65, 85);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Dark Mode Support */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(226, 232, 240);
}

::-webkit-scrollbar-thumb {
    background: rgb(148, 163, 184);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(100, 116, 139);
}

.dark ::-webkit-scrollbar-track {
    background: rgb(51, 65, 85);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgb(71, 85, 105);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgb(100, 116, 139);
}

/* ============================================
   FORM STYLING
   ============================================ */

.form-group {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid rgb(226, 232, 240);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background-color: white;
    color: rgb(15, 23, 42);
}

.dark .form-input {
    background-color: rgb(51, 65, 85);
    border-color: rgb(71, 85, 105);
    color: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input::placeholder {
    color: rgb(148, 163, 184);
}

.dark .form-input::placeholder {
    color: rgb(100, 116, 139);
}

/* Input Prefix and Suffix */
.input-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(100, 116, 139);
    font-weight: 500;
    font-size: 0.95rem;
}

.dark .input-prefix {
    color: rgb(156, 163, 175);
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(100, 116, 139);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
}

.dark .input-suffix {
    color: rgb(156, 163, 175);
}

/* Tooltip Icons */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 14px;
    cursor: help;
    opacity: 0.6;
    transition: all 0.3s ease;
    margin-left: 0.25rem;
}

.tooltip-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Error Messages */
.error-message {
    display: block;
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.4rem;
    min-height: 1.2rem;
    animation: slideDown 0.3s ease;
}

.error-message:empty {
    display: none;
}

/* ============================================
   BUTTON STYLING
   ============================================ */

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, rgb(14, 165, 233) 0%, rgb(6, 78, 115) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: rgb(226, 232, 240);
    color: rgb(51, 65, 85);
    border: 1.5px solid rgb(203, 213, 225);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark .btn-secondary {
    background-color: rgb(71, 85, 105);
    color: rgb(226, 232, 240);
    border-color: rgb(100, 116, 139);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgb(203, 213, 225);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dark .btn-secondary:hover:not(:disabled) {
    background-color: rgb(100, 116, 139);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   STEPPER NAVIGATION
   ============================================ */

.stepper-btn {
    cursor: pointer;
    border: none;
    position: relative;
    font-family: 'Poppins', sans-serif;
    transition: all 0.4s ease;
}

.stepper-btn:not(.active) {
    cursor: pointer;
}

.stepper-btn.active {
    animation: scaleIn 0.4s ease;
}

.stepper-line {
    transition: background-color 0.4s ease;
    background-color: rgb(203, 213, 225) !important;
}

.dark .stepper-line {
    background-color: rgb(71, 85, 105) !important;
}

.stepper-line.active {
    background: linear-gradient(90deg, rgb(14, 165, 233), rgb(6, 78, 115));
}

/* ============================================
   STEP CONTENT ANIMATION
   ============================================ */

.step-content {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.step-content.active {
    display: block;
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   RESULT CARDS & HIGHLIGHTS
   ============================================ */

/* Savings Card Animation */
#savingsCard {
    animation: highlightPulse 0.6s ease-out;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
        transform: scale(0.95);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(14, 165, 233, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
        transform: scale(1);
    }
}

/* ============================================
   COMPARISON CARDS
   ============================================ */

.comparison-card {
    transition: all 0.3s ease;
    position: relative;
}

.comparison-card:hover {
    transform: translateY(-2px);
}

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: rgb(22, 101, 52);
}

.dark .badge-success {
    background-color: rgba(34, 197, 94, 0.2);
    color: rgb(134, 239, 172);
}

.badge-warning {
    background-color: rgba(249, 115, 22, 0.1);
    color: rgb(124, 45, 18);
}

.dark .badge-warning {
    background-color: rgba(249, 115, 22, 0.2);
    color: rgb(254, 215, 170);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    .form-input {
        padding: 0.65rem 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .input-prefix,
    .input-suffix {
        font-size: 0.8rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.transition-fast {
    transition: all 0.15s ease;
}

.transition-smooth {
    transition: all 0.3s ease;
}

.glow-primary {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

.glow-green {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.glow-orange {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    header,
    footer,
    .stepper-btn,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }

    .step-content {
        display: block !important;
        page-break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }

    .dark {
        background: white;
        color: black;
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .form-input {
        border-width: 2px;
    }

    .btn-primary,
    .btn-secondary {
        border-width: 2px;
    }
}
