/* Mobile Optimization Styles for Wordexa */
/* These styles ONLY apply to mobile devices (max-width: 768px) */

@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }

    /* Header Mobile Fix */
    header {
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .logo img {
        height: 28px;
    }

    .header-right {
        gap: 8px;
    }

    .cta-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* Container Padding */
    .tool-container,
    .info-content {
        padding: 12px;
    }

    .tool-workspace {
        padding: 16px;
    }

    /* Tool Header */
    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tool-header h2 {
        font-size: 1.5rem;
    }

    /* Textarea Mobile Fix */
    textarea {
        width: 100%;
        font-size: 16px; /* Prevents iOS zoom */
        padding: 12px;
        min-height: 140px;
        box-sizing: border-box;
    }

    /* Button Mobile Fix */
    .tool-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
    }

    .btn {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .btn-action {
        padding: 12px 16px;
        font-size: 0.8rem;
    }

    /* Counter Stats Grid */
    #counter-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    #counter-stats > div {
        padding: 15px 10px;
    }

    #counter-stats > div > div:first-child {
        font-size: 1.5rem;
    }

    /* Find & Replace Input Fields */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Tool Cards (Explore Page) */
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tool-card {
        padding: 16px;
    }

    .tool-icon-wrapper {
        width: 50px;
        height: 50px;
    }

    /* Steps & Features Grid */
    .steps-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .step,
    .feature-card {
        padding: 16px;
    }

    /* Hero Section */
    .hero {
        min-height: 60vh;
        padding: 40px 16px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    /* Info Pages */
    .info-content h1 {
        font-size: 1.8rem;
    }

    .info-content h2 {
        font-size: 1.4rem;
    }

    .info-content p,
    .info-content li {
        font-size: 0.95rem;
    }

    /* Footer */
    footer {
        padding: 30px 12px;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }

    /* Tool Section Labels */
    .tool-section label {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    /* Back Button */
    .back-btn {
        width: 100%;
        text-align: center;
    }

    /* Prevent text overflow */
    .tool-name,
    .tool-desc {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Input fields */
    input[type="text"] {
        width: 100%;
        font-size: 16px; /* Prevents iOS zoom */
        padding: 12px;
        box-sizing: border-box;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .tool-actions {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .tool-header h2 {
        font-size: 1.3rem;
    }

    #counter-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
