/**
 * Secure Bridge Mobile Enhancements
 * Optimizes anonymous text transfer for mobile workflows
 * 
 * Perfect for quick SSH key transfers and secure text sharing on mobile
 */

@media (max-width: 768px) {
    
    /* ============================================
       MOBILE LAYOUT OPTIMIZATION
       ============================================ */
    
    .main-interface {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        margin-bottom: 30px;
    }
    
    /* ============================================
       MOBILE TEXT AREAS
       ============================================ */
    
    .text-input,
    .text-output {
        min-height: 140px !important;
        padding: 16px !important;
        font-size: 16px !important; /* Prevent iOS zoom */
        line-height: 1.5 !important;
        border-radius: 12px !important;
        border: 2px solid #333 !important;
        background: #111 !important;
        color: #fff !important;
        font-family: 'JetBrains Mono', monospace;
        resize: vertical;
        transition: border-color 0.3s ease;
    }
    
    .text-input:focus,
    .text-output:focus {
        border-color: #4ecdc4 !important;
        outline: none;
        box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
    }
    
    .text-input::placeholder {
        color: #666;
        font-style: italic;
    }
    
    /* Character counter styling */
    .char-counter {
        font-size: 0.9em !important;
        color: #888;
        text-align: right;
        margin-top: 8px;
    }
    
    /* ============================================
       MOBILE PASSWORD FIELDS
       ============================================ */
    
    .password-section {
        background: #0a0a0a !important;
        padding: 20px !important;
        border-radius: 12px !important;
        border: 1px solid #222 !important;
        margin-bottom: 20px;
    }
    
    .password-section h3 {
        color: #fff !important;
        margin-bottom: 15px !important;
        font-size: 1.1em;
        font-weight: 600;
    }
    
    .password-field {
        margin-bottom: 15px;
    }
    
    .password-field label {
        display: block;
        color: #ccc;
        font-size: 0.95em;
        margin-bottom: 8px;
        font-weight: 500;
    }
    
    .password-field input[type="text"],
    .password-field input[type="number"] {
        width: 100% !important;
        min-height: 48px !important;
        padding: 14px 16px !important;
        font-size: 16px !important; /* Prevent iOS zoom */
        border: 2px solid #333 !important;
        border-radius: 10px !important;
        background: #222 !important;
        color: #fff !important;
        font-weight: 500;
        transition: border-color 0.3s ease;
    }
    
    .password-field input:focus {
        border-color: #4ecdc4 !important;
        outline: none;
        box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
    }
    
    /* Password strength indicator */
    .password-strength-indicator {
        margin-top: 8px;
        font-size: 0.85em;
        padding: 6px 10px;
        border-radius: 6px;
        text-align: center;
        font-weight: 500;
    }
    
    .password-strength-weak {
        background: rgba(255, 68, 68, 0.2);
        color: #ff6b6b;
        border: 1px solid #ff4444;
    }
    
    .password-strength-good {
        background: rgba(255, 193, 7, 0.2);
        color: #ffc107;
        border: 1px solid #ffb300;
    }
    
    .password-strength-strong {
        background: rgba(78, 205, 196, 0.2);
        color: #4ecdc4;
        border: 1px solid #4ecdc4;
    }
    
    /* ============================================
       MOBILE ACTION BUTTONS
       ============================================ */
    
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
    }
    
    .primary-btn,
    .secondary-btn {
        width: 100% !important;
        min-height: 52px !important;
        padding: 14px 20px !important;
        font-size: 1.05em !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        border: none !important;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .primary-btn {
        background: linear-gradient(135deg, #4ecdc4 0%, #44b3a8 100%) !important;
        color: #000 !important;
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
    }
    
    .primary-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    }
    
    .primary-btn:active:not(:disabled) {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
    }
    
    .secondary-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: #fff !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .secondary-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
    
    .primary-btn:disabled,
    .secondary-btn:disabled {
        background: #333 !important;
        color: #666 !important;
        cursor: not-allowed;
        box-shadow: none;
        transform: none;
    }
    
    /* Button icons */
    .btn-icon {
        font-size: 1.2em;
    }
    
    /* ============================================
       MOBILE COPY FUNCTIONALITY
       ============================================ */
    
    .copy-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 8px !important;
        background: rgba(78, 205, 196, 0.2) !important;
        border: 1px solid #4ecdc4 !important;
        border-radius: 8px !important;
        color: #4ecdc4 !important;
        cursor: pointer;
        font-size: 1.1em;
        transition: all 0.3s ease;
    }
    
    .copy-btn:hover,
    .copy-btn:active {
        background: #4ecdc4 !important;
        color: #000 !important;
        transform: scale(0.95);
    }
    
    .copy-success {
        background: rgba(76, 175, 80, 0.2) !important;
        border-color: #4caf50 !important;
        color: #4caf50 !important;
    }
    
    /* ============================================
       MOBILE STATUS MESSAGES
       ============================================ */
    
    .status-message {
        padding: 14px 16px !important;
        border-radius: 10px !important;
        font-size: 0.95em !important;
        text-align: center;
        margin-bottom: 20px;
        font-weight: 500;
        border: 1px solid transparent;
    }
    
    .status-success {
        background: rgba(78, 205, 196, 0.1) !important;
        color: #4ecdc4 !important;
        border-color: #4ecdc4 !important;
    }
    
    .status-error {
        background: rgba(255, 107, 107, 0.1) !important;
        color: #ff6b6b !important;
        border-color: #ff4444 !important;
    }
    
    .status-info {
        background: rgba(102, 126, 234, 0.1) !important;
        color: #667eea !important;
        border-color: #667eea !important;
    }
    
    /* ============================================
       MOBILE SECTION HEADERS
       ============================================ */
    
    .section-header {
        margin-bottom: 15px;
    }
    
    .section-title {
        font-size: 1.2em !important;
        color: #fff !important;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    .section-subtitle {
        font-size: 0.9em !important;
        color: #888 !important;
        line-height: 1.5;
    }
    
    /* ============================================
       MOBILE SECURITY INDICATORS
       ============================================ */
    
    .security-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        background: rgba(78, 205, 196, 0.1);
        border: 1px solid #4ecdc4;
        border-radius: 20px;
        font-size: 0.85em;
        color: #4ecdc4;
        font-weight: 500;
        margin-bottom: 15px;
    }
    
    .security-icon {
        font-size: 1.1em;
    }
    
    /* ============================================
       MOBILE EXPIRATION TIMER
       ============================================ */
    
    .expiration-timer {
        background: rgba(255, 193, 7, 0.1) !important;
        border: 1px solid #ffc107 !important;
        color: #ffc107 !important;
        padding: 12px 16px !important;
        border-radius: 10px !important;
        text-align: center;
        font-weight: 600;
        font-size: 0.95em;
        margin-bottom: 20px;
    }
    
    .timer-icon {
        font-size: 1.2em;
        margin-right: 6px;
    }
    
    /* ============================================
       MOBILE HELP TEXT
       ============================================ */
    
    .help-text {
        background: #0a0a0a !important;
        border: 1px solid #222 !important;
        border-radius: 8px !important;
        padding: 14px 16px !important;
        font-size: 0.9em !important;
        color: #999 !important;
        line-height: 1.5;
        margin-top: 15px;
    }
    
    .help-text strong {
        color: #ccc;
    }
    
    /* ============================================
       MOBILE INTERFACE SECTIONS
       ============================================ */
    
    .upload-section,
    .download-section {
        background: #111 !important;
        border-radius: 12px !important;
        padding: 20px !important;
        border: 1px solid #222 !important;
        position: relative;
    }
    
    .upload-section {
        margin-bottom: 25px;
    }
    
    .download-section {
        border: 1px solid #333;
        background: #0a0a0a;
    }
    
    /* ============================================
       MOBILE RESPONSIVE UTILITIES
       ============================================ */
    
    .mobile-stack {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-center {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* ============================================
       MOBILE KEYBOARD OPTIMIZATION
       ============================================ */
    
    /* Ensure inputs don't get covered by keyboard */
    .active-input-section {
        padding-bottom: 120px;
        transition: padding 0.3s ease;
    }
    
    /* iOS keyboard handling */
    body.keyboard-open .tool-header,
    body.keyboard-open .site-nav {
        display: none !important;
    }
    
    body.keyboard-open .container {
        padding-top: 10px !important;
    }
}