/*
 * File: css/ai-paraphraser.css
 * Description: Styles for AI Paraphraser Tool
 * Updated: Download Button + Flex Layout
 */

#paraphrase-interface {
    --primary-color: #00d2d3;
    --primary-dark: #01a3a4;
}

/* Layout */
.paraphrase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    min-height: 500px;
}

@media (max-width: 900px) {
    .paraphrase-grid { grid-template-columns: 1fr; }
}

/* Editor Panes */
.editor-pane {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}

.pane-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-dark);
}

.word-count { font-size: 0.85rem; color: #888; font-weight: 400; }

textarea#paraphraseInput, .output-div {
    flex: 1;
    padding: 20px;
    border: none;
    resize: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    outline: none;
    min-height: 350px;
}
.output-div { background: #fafafa; }

/* Import Buttons (Bottom Left) */
.import-actions {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background: #fff;
    display: flex;
    gap: 10px;
    align-items: center;
}
.import-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}
.import-btn:hover { background: #f0f0f0; border-color: #ccc; color: #222; }

/* Copy Button */
.pane-footer {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background: #fff;
    text-align: right;
}
.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}
.copy-btn:hover { background: var(--primary-dark); }

/* Controls Top (Mode Selector Only) */
.controls-row {
    display: flex;
    justify-content: center; /* Centered */
    margin-bottom: 20px;
}

.mode-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-selector {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 250px; /* Wider for better click area */
}

/* NEW: Bottom Action Row */
.tool-action-row {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px; /* Space between buttons */
    align-items: center;
}

.action-btn {
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Primary "Paraphrase" Button */
.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 40px;
}
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 210, 211, 0.4);
}

/* Secondary "Download" Button */
.secondary-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 14px 30px; /* Slightly smaller padding to show hierarchy */
}
.secondary-btn:hover:not(:disabled) {
    background: #f0fdfd;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
.secondary-btn:disabled {
    border-color: #ddd;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
}

/* AI Status Banner */
.ai-status {
    background: linear-gradient(135deg, #e0fbfb 0%, #ffffff 100%);
    border: 1px solid rgba(0, 210, 211, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    display: none;
    animation: fadeIn 0.5s ease;
}
.ai-status.visible { display: block; }
.ai-status-content { display: flex; align-items: center; gap: 15px; }
.ai-status-icon { font-size: 2rem; flex-shrink: 0; }

/* Progress */
.progress-container {
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}
.progress-bar-track {
    background: rgba(0,0,0,0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 480px) {
    /* Stack buttons on mobile */
    .import-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    /* 🚨 CRITICAL FIX: Make buttons thumb-friendly (44px height) */
    .import-btn {
        padding: 12px 16px;
        min-height: 44px;
        flex: 1; /* Stretch to fill space */
        justify-content: center;
    }
    
    .copy-btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
    
    .tool-action-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .mode-selector {
        width: 100%;
        min-width: unset;
    }
}