/* GaelTax Mobile-First CSS Framework */

/* Mobile-First Base Styles */
:root {
    --mobile-padding: 1rem;
    --mobile-gap: 0.75rem;
    --touch-target: 44px;
    --mobile-font-base: 16px;
}

/* Prevent zoom on input focus (iOS Safari) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    font-size: 16px !important;
    -webkit-appearance: none;
    border-radius: 8px;
}

/* Touch-friendly buttons */
.btn-mobile {
    min-height: var(--touch-target);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-mobile:active {
    transform: scale(0.98);
}



/* Mobile-optimized forms */
.form-mobile {
    padding: var(--mobile-padding);
}

.form-group-mobile {
    margin-bottom: 1.5rem;
}

.form-group-mobile label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input-mobile {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-input-mobile:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile cards */
.card-mobile {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

/* Mobile modals - Fixed positioning and scrolling */
.modal-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    align-items: flex-end;
}

.modal-content-mobile {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    transform: translateZ(0);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Simple mobile modal - full screen approach with safe area */
@media (max-width: 768px) {
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        padding: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 80px));
    }
    
    .modal-content {
        width: 100%;
        max-width: none;
        margin: 0;
        min-height: calc(100vh - 2rem);
        border-radius: 12px;
        position: relative;
        padding-bottom: 100px;
    }
    
    .modal-content form {
        padding-bottom: 2rem;
    }
    
    .modal-content .btn {
        margin-bottom: 2rem;
    }
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .container {
        padding-left: var(--mobile-padding);
        padding-right: var(--mobile-padding);
    }
    
    .btn {
        min-height: var(--touch-target);
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    h1 { font-size: 1.875rem; line-height: 1.2; }
    h2 { font-size: 1.5rem; line-height: 1.3; }
    h3 { font-size: 1.25rem; line-height: 1.4; }
}

@media (max-width: 480px) {
    :root {
        --mobile-padding: 0.75rem;
        --mobile-gap: 0.5rem;
    }
    
    .card-mobile {
        padding: 1rem;
        border-radius: 8px;
    }
    
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .card:hover,
    .feature-card:hover {
        transform: none;
    }
    
    .btn:active,
    .card:active,
    .feature-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .btn,
    .security-badge {
        min-height: var(--touch-target);
        min-width: var(--touch-target);
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}