/* IfOnly.ai - Mobile App-Style Homepage */

/* ========================================
   MOBILE APP FOUNDATION
   ======================================== */

:root {
    --app-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(247, 147, 26, 0.2);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 15px 40px rgba(247, 147, 26, 0.3);
    --primary-orange: #F7931A;
    --primary-gradient: linear-gradient(135deg, #F7931A, #FFA500);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.65);
    --success-green: #10D876;
    --danger-red: #FF5757;
    --tap-highlight: rgba(247, 147, 26, 0.1);
}

/* Hero Section - Simplified for Mobile */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem 1rem !important;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
        font-weight: 700;
        line-height: 1.15;
        letter-spacing: -0.02em;
        margin-bottom: 0.75rem;
    }
    
    .hero-section .lead {
        font-size: 1.125rem !important;
        color: var(--text-secondary);
        margin-bottom: 1.5rem;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.4;
    }
}

/* Primary Hero CTA Button */
.hero-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(247, 147, 26, 0.35);
    margin-top: 1rem;
    margin-bottom: 2rem;
    min-height: 56px;
    width: 100%;
    max-width: 320px;
    -webkit-tap-highlight-color: transparent;
}

.hero-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(247, 147, 26, 0.45);
    color: white;
}

.hero-cta-button:active {
    transform: scale(0.98);
}

.hero-cta-icon {
    width: 20px;
    height: 20px;
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

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

/* Calculator Cards Container */
.calculator-cards-section {
    padding: 2.5rem 1rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    scroll-margin-top: 1rem;
}

.calculator-cards-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Calculator Cards Grid */
.calculator-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    padding: 0;
}

/* Individual Calculator Card */
.calculator-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    display: block;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.calculator-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
}

.calculator-card:hover::before {
    transform: scaleX(1);
}

/* Card Header */
.calculator-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calculator-card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calculator-card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.calculator-card-badge {
    background: rgba(247, 147, 26, 0.15);
    color: var(--primary-orange);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(247, 147, 26, 0.3);
}

/* Card Content */
.calculator-card-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculator-card-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Card Examples */
.calculator-card-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.example-pill {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

/* Card Action Button */
.calculator-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.calculator-card-cta {
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 1rem;
}

.calculator-card-arrow {
    width: 20px;
    height: 20px;
    color: var(--primary-orange);
    transition: transform 0.3s ease;
}

.calculator-card:hover .calculator-card-arrow {
    transform: translateX(4px);
}

/* Quick Start Presets */
.quick-presets-section {
    padding: 1.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    margin: 2rem 1rem;
}

.quick-presets-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-presets-title svg {
    width: 16px;
    height: 16px;
    color: var(--primary-orange);
}

/* Horizontal Scrolling Preset Container */
.quick-presets-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0 1rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.quick-presets-scroll::-webkit-scrollbar {
    height: 4px;
}

.quick-presets-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.quick-presets-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 2px;
}

/* Individual Preset Button */
.preset-button {
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid rgba(247, 147, 26, 0.3);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 110px;
    min-height: 80px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.preset-button:active {
    transform: scale(0.95);
    background: rgba(247, 147, 26, 0.2);
}

.preset-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.preset-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.preset-amount {
    font-size: 0.8125rem;
    color: var(--primary-orange);
    font-weight: 500;
}

/* Stats Section */
.app-stats-section {
    display: flex;
    justify-content: space-around;
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    margin: 2rem 1rem;
    margin-bottom: 2.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-orange);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Tablet Adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    .calculator-cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .calculator-card {
        padding: 2rem;
    }
}

/* Desktop Adjustments */
@media (min-width: 992px) {
    .calculator-cards-section {
        padding: 3rem 2rem;
    }
    
    .calculator-cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .calculator-card {
        padding: 2.5rem;
        border-radius: 24px;
    }
    
    .calculator-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-hover-shadow);
    }
    
    .quick-presets-section {
        max-width: 800px;
        margin: 2rem auto;
    }
    
    .app-stats-section {
        max-width: 600px;
        margin: 2rem auto;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Mobile-First Responsive Overrides */
/* Prevent horizontal scrolling on mobile */
* {
    max-width: 100vw !important;
}

.container, .container-fluid, .row {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Fix navbar dropdowns - don't clip them */
.navbar, .navbar .container, .navbar .container-fluid {
    overflow: visible !important;
}

.dropdown-menu {
    z-index: 1100;
}

/* Fix input-group layout on mobile */
.amount-input-group .input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
}

.amount-input-group .input-group-text {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

.amount-input-group .form-control {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Mobile-specific input group fixes */
@media (max-width: 768px) {
    .amount-input-group .input-group-lg .input-group-text {
        font-size: 1.25rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    .amount-input-group .input-group-lg .form-control {
        font-size: 1.25rem !important;
        padding: 0.5rem 0.75rem !important;
    }
}

@media (max-width: 576px) {
    .amount-input-group .input-group-lg .input-group-text {
        font-size: 1.1rem !important;
        padding: 0.5rem 0.6rem !important;
    }
    
    .amount-input-group .input-group-lg .form-control {
        font-size: 1.1rem !important;
        padding: 0.5rem 0.6rem !important;
    }
}

/* Responsive explanation box styling */
@media (max-width: 576px) {
    .alert h6 {
        font-size: 0.9rem !important;
    }
    .alert div {
        font-size: 0.8rem !important;
    }
    .alert {
        padding: 0.875rem !important;
    }
    .alert ul {
        padding-left: 1rem !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .alert h6 {
        font-size: 0.95rem !important;
    }
    .alert div {
        font-size: 0.85rem !important;
    }
}

@media (min-width: 769px) {
    .alert h6 {
        font-size: 1rem !important;
    }
    .alert div {
        font-size: 0.9rem !important;
    }
}

/* Prevent step containers from causing overflow */
.step-container {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Prevent expense grid overflow */
.expense-type-grid {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Haptic Feedback Styles */
.haptic-touch {
    position: relative;
}

.haptic-touch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(247, 147, 26, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease;
}

.haptic-touch:active::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
}

/* Floating Action Button (FAB) */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 1000;
    display: none; /* Hidden by default, shown after scroll */
}

.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    box-shadow: 0 6px 20px rgba(247, 147, 26, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(247, 147, 26, 0.5);
}

.fab-button:active {
    transform: scale(0.95);
}

.fab-button svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* Show FAB after scrolling past hero */
@media (max-width: 768px) {
    .fab-container.fab-visible {
        display: block;
        animation: fabSlideIn 0.3s ease-out;
    }
}

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

/* Hide FAB on larger screens where navigation is easier */
@media (min-width: 769px) {
    .fab-container {
        display: none !important;
    }
}