/* ===== AI TEXT TRANSLATOR CSS ===== */

/* Quick Language Pills */
.trans-quick-langs {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.trans-quick-label { font-size: 13px; font-weight: 700; color: #6b7280; white-space: nowrap; }
.trans-quick-grid  { display: flex; gap: 8px; flex-wrap: wrap; }
.trans-quick-btn {
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.trans-quick-btn:hover { border-color: #3b82f6; color: #1d4ed8; background: #eff6ff; }
.trans-quick-btn.active { background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff; border-color: #2563eb; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }

/* Main Translator Layout */
.trans-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    margin-bottom: 16px;
    align-items: start;
}

/* Panel */
.trans-panel {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.trans-from-panel:focus-within { border-color: #3b82f6; }
.trans-to-panel { border-color: #e5e7eb; }

.trans-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    background: #f8fafc;
    gap: 10px;
}

.trans-lang-select {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    cursor: pointer;
    outline: none;
    flex: 1;
    padding: 4px 0;
}

.trans-panel-actions { display: flex; gap: 6px; }
.trans-icon-btn {
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 600;
    color: #374151;
}
.trans-icon-btn:hover { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; }

/* Textarea */
.trans-textarea {
    width: 100%;
    min-height: 200px;
    border: none;
    outline: none;
    padding: 16px;
    font-size: 16px;
    line-height: 1.7;
    color: #1f2937;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.trans-textarea::placeholder { color: #9ca3af; }

/* Result */
.trans-result-wrap {
    min-height: 200px;
    padding: 16px;
    position: relative;
}
.trans-result-placeholder { color: #9ca3af; font-size: 15px; padding: 4px 0; }
.trans-result-text {
    font-size: 16px;
    line-height: 1.7;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
}
.trans-result-error { font-size: 14px; color: #dc2626; padding: 4px 0; }

/* Loading dots */
.trans-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 14px;
}
.trans-dots { display: flex; gap: 5px; }
.trans-dots span {
    width: 8px; height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: trans-bounce 1.2s infinite;
}
.trans-dots span:nth-child(2) { animation-delay: 0.2s; }
.trans-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes trans-bounce { 0%,80%,100%{transform:scale(0.8);opacity:0.5} 40%{transform:scale(1.2);opacity:1} }

/* Panel Footer */
.trans-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-top: 1px solid #f3f4f6;
    background: #f8fafc;
}
.trans-char-count  { font-size: 12px; color: #9ca3af; font-weight: 600; }
.trans-match-score { font-size: 12px; color: #059669; font-weight: 600; }
.trans-footer-btns { display: flex; gap: 6px; }
.trans-copy-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.trans-copy-btn:hover { background: #e5e7eb; }

/* Swap Button */
.trans-swap-wrap { display: flex; align-items: center; justify-content: center; padding-top: 60px; }
.trans-swap-btn {
    width: 44px; height: 44px;
    background: linear-gradient(135deg,#3b82f6,#2563eb);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
    transition: all 0.25s;
    display: flex; align-items: center; justify-content: center;
}
.trans-swap-btn:hover { transform: scale(1.15) rotate(180deg); box-shadow: 0 6px 20px rgba(59,130,246,0.45); }

/* Action Row */
.trans-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.trans-translate-btn {
    background: linear-gradient(135deg,#3b82f6,#2563eb);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(59,130,246,0.3);
    transition: all 0.25s;
}
.trans-translate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(59,130,246,0.4); }
.trans-translate-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.trans-auto-hint { font-size: 12px; color: #9ca3af; }

/* Sample Phrases */
.trans-phrases {
    background: linear-gradient(135deg,#f8fafc,#f1f5f9);
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 24px;
}
.trans-phrases-title { font-size: 14px; font-weight: 800; color: #1f2937; margin-bottom: 12px; }
.trans-phrases-grid  { display: flex; flex-wrap: wrap; gap: 8px; }
.trans-phrase-btn {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}
.trans-phrase-btn:hover { border-color: #3b82f6; color: #1d4ed8; background: #eff6ff; }

/* Info Box */
.info-box { background: linear-gradient(135deg,#eff6ff,#dbeafe); border-radius: 16px; padding: 28px; margin-bottom: 24px; }
.info-box h4 { color: #1e3a8a; font-size: 20px; margin-bottom: 18px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.info-item { background: #fff; border-radius: 12px; padding: 16px; color: #374151; font-size: 14px; line-height: 1.6; }
.info-item strong { display: block; color: #2563eb; font-size: 14px; font-weight: 700; margin-bottom: 4px; }

/* Responsive */
@media (max-width: 900px) {
    .trans-main { grid-template-columns: 1fr; }
    .trans-swap-wrap { padding-top: 0; transform: rotate(90deg); }
}
@media (max-width: 600px) {
    .trans-quick-langs { flex-direction: column; align-items: flex-start; }
    .trans-action-row  { flex-direction: column; align-items: flex-start; }
    .trans-translate-btn { width: 100%; }
    .info-grid { grid-template-columns: 1fr; }
}