/* UI & STYLING */
#h2h-fab-button {
    position: fixed; bottom: 30px; right: 30px;
    background: linear-gradient(135deg, #1e8c36, #15732b);
    color: #fff; border-radius: 50px; padding: 12px 20px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    cursor: pointer; z-index: 99999; border: 2px solid #fff;
    font-family: -apple-system, sans-serif; transition: 0.3s;
}
#h2h-fab-button:hover { transform: scale(1.05); }

.h2h-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75); display: none; z-index: 999999;
    justify-content: center; align-items: center; backdrop-filter: blur(5px);
}

.h2h-modal-content {
    background: #fdfdfd; width: 95%; max-width: 1250px; border-radius: 15px;
    padding: 25px; position: relative; font-family: -apple-system, sans-serif;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.h2h-close-btn { position: absolute; top: 15px; right: 20px; font-size: 30px; cursor: pointer; color: #999; }
.h2h-header { text-align: center; margin-bottom: 15px; }
.h2h-header h2 { margin: 0; font-size: 22px; color: #222; }

.h2h-status-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; position: relative; min-height: 25px;}
#h2h_toast {
    position: absolute; left: 50%; transform: translateX(-50%);
    background: #222; color: #fff; padding: 6px 16px; border-radius: 20px;
    font-size: 12px; display: none; z-index: 10;
}

.h2h-progress-wrapper { background: #eee; border-radius: 10px; height: 16px; margin-bottom: 15px; position: relative; overflow: hidden; display: none; border: 1px solid #ddd; }
#h2h_progressBar { height: 100%; background: linear-gradient(90deg, #28a745, #5cd85d); width: 0%; transition: width 0.3s; }
#h2h_progressLabel { position: absolute; width: 100%; text-align: center; top: 0; left: 0; font-size: 10px; font-weight: bold; color: #333; line-height: 16px; }

.h2h-main-layout { display: flex; gap: 20px; }
.h2h-column { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.h2h-column label { font-weight: 700; margin-bottom: 8px; display: block; color: #444; font-size: 14px; }

textarea, .h2h-output-div {
    width: 100%; height: 450px; border: 1.5px solid #cbd5e0; border-radius: 10px;
    padding: 15px; font-size: 18px; line-height: 1.7; outline: none; box-sizing: border-box;
    background: #fff;
}
.h2h-output-div { overflow-y: auto; white-space: pre-wrap; background: #fff; border-style: dashed; }

.h2h-trans-word { border-bottom: 2px dotted #2271b1; cursor: pointer; transition: 0.2s; position: relative; }

@keyframes h2hHighlightFlash {
    0% { background-color: #f6e05e; }
    100% { background-color: transparent; }
}
.h2h-highlight-flash { animation: h2hHighlightFlash 2s ease-out forwards; border-radius: 3px; }

.h2h-suggestion-box {
    position: absolute; background: white; border: 1px solid #ccc; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 1000001; display: none; 
    min-width: 180px; border-radius: 8px; padding: 5px 0;
}
.h2h-suggestion-item { padding: 10px 15px; cursor: pointer; font-size: 16px; border-bottom: 1px solid #f1f1f1; }
.h2h-suggestion-item:hover { background: #2271b1; color: white; }

.h2h-bulk-dialog { padding: 10px; background: #f0f7ff; border-top: 2px solid #2271b1; display: flex; flex-direction: column; gap: 5px; }
.h2h-bulk-btn { border: none; padding: 8px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 12px; }
.btn-only { background: #e2e8f0; color: #4a5568; }
.btn-all { background: #2271b1; color: #fff; }

.h2h-footer-btns { display: flex; gap: 12px; margin-top: 15px; }
.h2h-btn { padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 15px; flex: 1; transition: 0.2s; }
.btn-convert { background: #28a745; color: white; }
.btn-copy { background: #2271b1; color: white; }
.btn-insert { background: #d63638; color: white; flex: 1.5; }

@media (max-width: 900px) { .h2h-main-layout { flex-direction: column; } }