/**
 * Tools Index Mobile Enhancements
 * Optimizes the tools overview page for mobile discovery
 * 
 * Gateway to all 6 revolutionary ZYZ DYNAMICS tools on mobile
 */

@media (max-width: 768px) {
    
    /* ============================================
       MOBILE LAYOUT OPTIMIZATION
       ============================================ */
    
    .container {
        padding: 25px 15px !important;
        min-height: auto !important;
        justify-content: flex-start !important;
    }
    
    /* ============================================
       MOBILE HEADER SECTION
       ============================================ */
    
    header {
        margin-bottom: 25px !important;
    }
    
    .logo {
        font-size: 2.2em !important;
        letter-spacing: 2px !important;
        margin-bottom: 8px !important;
    }
    
    .tagline {
        font-size: 1em !important;
        letter-spacing: 0.5px !important;
    }
    
    /* ============================================
       MOBILE PHILOSOPHY SECTION
       ============================================ */
    
    .philosophy {
        padding: 20px !important;
        border-radius: 12px !important;
        margin-bottom: 25px !important;
        background: linear-gradient(135deg, #0a0a0a 0%, #111 100%) !important;
        border: 1px solid #333 !important;
    }
    
    .philosophy h2 {
        font-size: 1.3em !important;
        color: #4ecdc4 !important;
        margin-bottom: 12px !important;
        text-align: center;
        font-weight: 600;
    }
    
    .philosophy p {
        font-size: 0.95em !important;
        line-height: 1.6 !important;
        color: #e0e0e0 !important;
        text-align: center;
    }
    
    /* ============================================
       MOBILE TOOLS GRID
       ============================================ */
    
    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        margin-bottom: 30px !important;
    }
    
    .tool-card {
        padding: 20px !important;
        border-radius: 12px !important;
        background: linear-gradient(135deg, #111 0%, #1a1a1a 100%) !important;
        border: 1px solid #333 !important;
        text-decoration: none !important;
        color: inherit !important;
        transition: all 0.3s ease;
        display: block !important;
        position: relative;
        overflow: hidden;
        min-height: 120px;
    }
    
    .tool-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(78, 205, 196, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .tool-card:active {
        transform: scale(0.98);
        border-color: #4ecdc4;
    }
    
    .tool-card:active::before {
        opacity: 1;
    }
    
    /* ============================================
       MOBILE TOOL CARD CONTENT
       ============================================ */
    
    .tool-header {
        display: flex !important;
        align-items: flex-start !important;
        margin-bottom: 12px !important;
        gap: 15px;
    }
    
    .tool-icon {
        font-size: 2.5em !important;
        flex-shrink: 0;
        width: 60px;
        text-align: center;
        line-height: 1;
    }
    
    .tool-title {
        font-size: 1.4em !important;
        color: #fff !important;
        font-weight: 600;
        margin-bottom: 0;
        line-height: 1.2;
        flex: 1;
    }
    
    .tool-subtitle {
        font-size: 0.9em !important;
        color: #ccc !important;
        line-height: 1.5 !important;
        margin-bottom: 12px !important;
        padding-left: 75px; /* Align with title */
    }
    
    .tool-features {
        font-size: 0.85em !important;
        color: #999 !important;
        line-height: 1.5 !important;
        padding-left: 75px; /* Align with title */
    }
    
    .tool-features ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .tool-features li {
        margin-bottom: 4px !important;
        position: relative;
        padding-left: 15px;
    }
    
    .tool-features li:before {
        content: "✓" !important;
        color: #4ecdc4 !important;
        font-weight: bold !important;
        position: absolute;
        left: 0;
        top: 0;
    }
    
    /* Individual tool styling */
    .tool-card:nth-child(1) .tool-icon { color: #4ecdc4; } /* Markdown Studio */
    .tool-card:nth-child(2) .tool-icon { color: #667eea; } /* Secure Bridge */
    .tool-card:nth-child(3) .tool-icon { color: #ff6b6b; } /* Frequency Lab */
    .tool-card:nth-child(4) .tool-icon { color: #ffc107; } /* Time Machine */
    .tool-card:nth-child(5) .tool-icon { color: #764ba2; } /* AI Formatter */
    .tool-card:nth-child(6) .tool-icon { color: #44b3a8; } /* QR Generator */
    
    /* ============================================
       MOBILE TOOL CATEGORIES
       ============================================ */
    
    .tool-category {
        margin-bottom: 25px;
    }
    
    .category-title {
        font-size: 1.3em !important;
        color: #fff !important;
        font-weight: 600;
        margin-bottom: 15px;
        text-align: center;
        padding-bottom: 8px;
        border-bottom: 1px solid #333;
    }
    
    .category-description {
        font-size: 0.9em !important;
        color: #888 !important;
        text-align: center;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    
    /* ============================================
       MOBILE QUICK ACCESS BADGES
       ============================================ */
    
    .quick-access {
        display: flex !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-bottom: 25px;
        flex-wrap: wrap;
    }
    
    .access-badge {
        background: rgba(78, 205, 196, 0.1) !important;
        color: #4ecdc4 !important;
        border: 1px solid #4ecdc4 !important;
        padding: 6px 12px !important;
        border-radius: 15px !important;
        font-size: 0.8em !important;
        font-weight: 500;
        text-decoration: none !important;
        transition: all 0.3s ease;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .access-badge:active {
        background: #4ecdc4 !important;
        color: #000 !important;
        transform: scale(0.95);
    }
    
    /* ============================================
       MOBILE STATS SECTION
       ============================================ */
    
    .tools-stats {
        background: #0a0a0a !important;
        border: 1px solid #222 !important;
        border-radius: 10px !important;
        padding: 20px !important;
        margin-bottom: 25px;
        text-align: center;
    }
    
    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
    }
    
    .stat-item {
        text-align: center;
    }
    
    .stat-number {
        font-size: 1.8em !important;
        font-weight: 700;
        color: #4ecdc4;
        margin-bottom: 4px;
        font-family: 'JetBrains Mono', monospace;
    }
    
    .stat-label {
        font-size: 0.8em !important;
        color: #888;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* ============================================
       MOBILE CALL TO ACTION
       ============================================ */
    
    .cta-section {
        background: linear-gradient(135deg, rgba(78, 205, 196, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%) !important;
        border: 1px solid #4ecdc4 !important;
        border-radius: 12px !important;
        padding: 25px !important;
        text-align: center;
        margin-bottom: 25px;
    }
    
    .cta-title {
        font-size: 1.3em !important;
        color: #fff !important;
        font-weight: 600;
        margin-bottom: 10px;
    }
    
    .cta-subtitle {
        font-size: 0.95em !important;
        color: #ccc !important;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    
    .cta-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .cta-btn {
        width: 100% !important;
        min-height: 50px !important;
        background: linear-gradient(135deg, #4ecdc4 0%, #44b3a8 100%) !important;
        color: #000 !important;
        text-decoration: none !important;
        border: none !important;
        border-radius: 12px !important;
        font-size: 1em !important;
        font-weight: 600 !important;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
    }
    
    .cta-btn.secondary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: #fff !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .cta-btn:hover,
    .cta-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    }
    
    .cta-btn.secondary:hover,
    .cta-btn.secondary:active {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
    
    .cta-btn::before {
        content: "🚀";
        font-size: 1.2em;
    }
    
    .cta-btn.secondary::before {
        content: "📚";
    }
    
    /* ============================================
       MOBILE FOOTER
       ============================================ */
    
    footer {
        margin-top: 30px !important;
        padding-top: 25px !important;
        border-top: 1px solid #333 !important;
        text-align: center !important;
        font-size: 0.8em !important;
        color: #666 !important;
        line-height: 1.6;
    }
    
    footer p {
        margin-bottom: 6px;
    }
    
    footer a {
        color: #4ecdc4;
        text-decoration: none;
    }
    
    footer a:active {
        color: #44b3a8;
    }
    
    /* ============================================
       MOBILE SEARCH/FILTER
       ============================================ */
    
    .tools-search {
        background: #111 !important;
        border: 2px solid #333 !important;
        border-radius: 10px !important;
        padding: 12px 16px !important;
        font-size: 16px !important; /* Prevent iOS zoom */
        color: #fff !important;
        width: 100% !important;
        margin-bottom: 20px;
        font-family: inherit;
        transition: border-color 0.3s ease;
    }
    
    .tools-search:focus {
        border-color: #4ecdc4 !important;
        outline: none;
        box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
    }
    
    .tools-search::placeholder {
        color: #666;
        font-style: italic;
    }
    
    .search-results-count {
        font-size: 0.85em;
        color: #888;
        text-align: center;
        margin-bottom: 15px;
    }
    
    /* ============================================
       MOBILE PERFORMANCE OPTIMIZATIONS
       ============================================ */
    
    /* Reduce visual complexity on mobile */
    .tool-card::before {
        transition-duration: 0.2s !important;
    }
    
    /* Optimize scroll performance */
    .tools-grid {
        -webkit-overflow-scrolling: touch;
    }
    
    /* ============================================
       MOBILE UTILITY CLASSES
       ============================================ */
    
    .mobile-hidden { display: none !important; }
    .mobile-only { display: block !important; }
    .mobile-center { text-align: center !important; }
    .mobile-full-width { width: 100% !important; }
    .mobile-stack { flex-direction: column !important; }
    .mobile-small-text { font-size: 0.8em !important; }
    
    /* ============================================
       MOBILE ACCESSIBILITY ENHANCEMENTS
       ============================================ */
    
    /* Enhanced touch targets */
    .tool-card,
    .access-badge,
    .cta-btn {
        min-height: 60px !important;
        touch-action: manipulation;
    }
    
    /* Better focus indicators */
    .tool-card:focus,
    .cta-btn:focus {
        outline: 3px solid #4ecdc4 !important;
        outline-offset: 2px;
    }
    
    /* Improved contrast for mobile screens */
    .tool-title {
        color: #fff !important;
    }
    
    .tool-subtitle {
        color: #e0e0e0 !important;
    }
    
    .tool-features {
        color: #bbb !important;
    }
}

/* ============================================
   DESKTOP-ONLY UTILITIES
   ============================================ */

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
    .cta-section { display: none !important; } /* Desktop has different layout */
}