/* Mobile-specific styles for Trust Wallet */

/* Hide left content (graphics section) on mobile */
@media (max-width: 768px) {
    .graphics-section {
        display: none !important;
    }
    
    .content-section {
        width: 100% !important;
        min-height: 100vh !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 20px !important;
    }
    
    .container {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    /* Specific styles for index.html */
    .hero-section {
        width: 100% !important;
        min-height: 100vh !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding: 20px !important;
    }
    
    .hero-content {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* Center all content on mobile */
    .content-section {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        height: 100vh !important;
    }
    
    /* Hide left content for create-password page */
    .graphics-section {
        display: none !important;
    }
    
    /* Ensure content section takes full width on create-password */
    .container {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .hero-title {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 16px !important;
    }
    
    .hero-subtitle {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 32px !important;
    }
    
    .cta-buttons {
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
    }
    
    .cta-button {
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    /* Larger logo for mobile */
    .logo-icon {
        max-width: 350px !important;
    }
    
    .logo-icon svg {
        width: 100% !important;
        height: auto !important;
    }
}

/* Touch-friendly button sizes */
@media (max-width: 768px) {
    .wallet-option {
        min-height: 60px;
        padding: 16px;
        margin-bottom: 8px;
    }
    
    .wallet-icon {
        min-width: 48px;
        min-height: 48px;
    }
    
    .back-button {
        min-width: 44px;
        min-height: 44px;
        font-size: 18px;
    }
}

/* Prevent zoom on input focus */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* Better touch targets */
@media (max-width: 768px) {
    button, .wallet-option, .back-button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Optimize for mobile scrolling */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    .container {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: flex;
        flex-direction: column;
    }
    
    .content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }
    
    .main-heading {
        text-align: center;
        margin-bottom: 16px;
    }
    
    .subtitle {
        text-align: center;
        margin-bottom: 32px;
    }
    
    .wallet-options {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 16px;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .container {
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
            padding-top: max(16px, env(safe-area-inset-top));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
        
        .back-button {
            top: max(16px, env(safe-area-inset-top));
            left: max(16px, env(safe-area-inset-left));
        }
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .content-section {
        padding-top: 20px;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .main-heading {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .wallet-options {
        gap: 12px;
    }
    
    .wallet-option {
        padding: 12px;
        min-height: 50px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .wallet-icon svg,
    .logo-icon svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Already dark theme, no changes needed */
}

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

/* Focus indicators for accessibility */
@media (max-width: 768px) {
    .wallet-option:focus,
    .back-button:focus {
        outline: 2px solid #48FF91;
        outline-offset: 2px;
    }
}

/* Loading states */
@media (max-width: 768px) {
    .wallet-option.loading {
        pointer-events: none;
        opacity: 0.7;
    }
    
    .wallet-option.loading::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 16px;
        width: 16px;
        height: 16px;
        margin-top: -8px;
        border: 2px solid transparent;
        border-top: 2px solid #48FF91;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Larger logo for all mobile devices */
@media (max-width: 768px) {
    .logo-icon {
        max-width: 350px !important;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        max-width: 320px !important;
    }
}

@media (max-width: 360px) {
    .logo-icon {
        max-width: 280px !important;
    }
}

/* Enhanced mobile optimizations - NEW ADDITIONS */

/* Better typography scaling for mobile */
@media (max-width: 768px) {
    .main-heading {
        font-size: 28px !important;
        line-height: 1.3 !important;
        margin-bottom: 20px !important;
    }
    
    .step-heading {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }
    
    .wallet-name {
        font-size: 18px !important;
        line-height: 1.4 !important;
        margin-bottom: 6px !important;
    }
    
    .wallet-description {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    .input-label {
        font-size: 16px !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
    }
    
    .input-hint {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin-top: 6px !important;
    }
}

/* Improved spacing and padding for mobile */
@media (max-width: 768px) {
    .content-section {
        padding: 24px 20px !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .main-content {
        padding: 0 !important;
        margin-bottom: 24px !important;
    }
    
    .wallet-options {
        gap: 12px !important;
        margin-bottom: 24px !important;
    }
    
    .wallet-option {
        padding: 18px 20px !important;
        margin-bottom: 0 !important;
        border-radius: 12px !important;
    }
    
    .form-group {
        margin-bottom: 20px !important;
    }
    
    .form-actions {
        margin-top: 24px !important;
    }
}

/* Enhanced touch targets for better usability */
@media (max-width: 768px) {
    .wallet-option {
        min-height: 72px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .wallet-option:active {
        transform: scale(0.98) !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
    }
    
    .cta-button,
    .import-btn {
        min-height: 56px !important;
        padding: 16px 24px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        transition: all 0.2s ease !important;
    }
    
    .cta-button:active,
    .import-btn:active {
        transform: scale(0.98) !important;
    }
    
    .back-button {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 12px 16px !important;
        border-radius: 10px !important;
        transition: all 0.2s ease !important;
    }
    
    .back-button:active {
        transform: scale(0.95) !important;
    }
}

/* Better form inputs for mobile */
@media (max-width: 768px) {
    .text-input,
    .textarea-input,
    .password-input {
        min-height: 56px !important;
        padding: 16px 18px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
        transition: all 0.2s ease !important;
    }
    
    .text-input:focus,
    .textarea-input:focus,
    .password-input:focus {
        border-color: #48FF91 !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
        outline: none !important;
    }
    
    /* Fix for all forms - reset padding for inputs inside input-field */
    .input-field .password-input,
    .input-field .text-input,
    .input-field .textarea-input {
        padding: 0 !important;
        border: none !important;
        background: none !important;
        min-height: auto !important;
        border-radius: 0 !important;
    }
    
    .input-field {
        min-height: 56px !important;
        padding: 0 16px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .input-field:focus-within {
        border-color: #48FF91 !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
    }
    
    /* Special handling for textarea inside input-field */
    .input-field .textarea-input {
        min-height: 120px !important;
        resize: vertical !important;
        align-self: stretch !important;
        padding: 12px 0 !important;
    }
    
    /* Ensure proper spacing between form groups */
    .form-group {
        margin-bottom: 24px !important;
    }
    
    /* Better spacing for form actions */
    .form-actions {
        margin-top: 32px !important;
    }
    
    .textarea-input {
        min-height: 120px !important;
        resize: vertical !important;
    }
    
    .clear-btn {
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 50% !important;
        transition: all 0.2s ease !important;
    }
    
    .clear-btn:active {
        background-color: rgba(255, 255, 255, 0.1) !important;
        transform: scale(0.9) !important;
    }
}

/* Improved checkbox and terms styling */
@media (max-width: 768px) {
    .terms-checkbox {
        margin: 20px 0 !important;
        padding: 0 !important;
    }
    
    .terms-checkbox input[type="checkbox"] {
        min-width: 22px !important;
        min-height: 22px !important;
        margin-top: 2px !important;
        accent-color: #48FF91 !important;
    }
    
    .terms-text {
        font-size: 14px !important;
        line-height: 1.6 !important;
        padding-left: 8px !important;
    }
}

/* Better responsive breakpoints */
@media (max-width: 480px) {
    .content-section {
        padding: 20px 16px !important;
    }
    
    .main-heading {
        font-size: 24px !important;
        margin-bottom: 16px !important;
    }
    
    .step-heading {
        font-size: 20px !important;
        margin-bottom: 10px !important;
    }
    
    .wallet-option {
        padding: 16px 18px !important;
        min-height: 68px !important;
    }
    
    .wallet-name {
        font-size: 16px !important;
    }
    
    .wallet-description {
        font-size: 13px !important;
    }
    
    .cta-button,
    .import-btn {
        min-height: 52px !important;
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 360px) {
    .content-section {
        padding: 16px 12px !important;
    }
    
    .main-heading {
        font-size: 22px !important;
        margin-bottom: 14px !important;
    }
    
    .step-heading {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }
    
    .wallet-option {
        padding: 14px 16px !important;
        min-height: 64px !important;
    }
    
    .cta-button,
    .import-btn {
        min-height: 48px !important;
        padding: 12px 18px !important;
        font-size: 14px !important;
    }
}

/* Prevent text selection on buttons for better UX */
@media (max-width: 768px) {
    .wallet-option,
    .cta-button,
    .import-btn,
    .back-button {
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
}

/* Smooth scrolling and performance optimizations */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth !important;
    }
    
    * {
        -webkit-tap-highlight-color: transparent !important;
    }
    
    .wallet-option,
    .cta-button,
    .import-btn,
    .back-button {
        -webkit-touch-callout: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
} 