/* ═══════════════════════════════════════════
   Ihsan Foundation Translator — Stylesheet
═══════════════════════════════════════════ */

/* Screen-reader only */
.iht-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ── Language Bar ── */
#iht-lang-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999999;
    background: #0a2e1a;
    border-bottom: 2px solid #00a550;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    height: 44px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#iht-lang-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

#iht-globe-icon {
    color: #00c060;
    display: flex;
    align-items: center;
}

/* ── Dropdown Wrapper ── */
#iht-dropdown-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

#iht-lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(0,165,80,0.5);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 34px 6px 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    min-width: 150px;
}

#iht-lang-select:hover,
#iht-lang-select:focus {
    border-color: #00a550;
    background: rgba(0,165,80,0.15);
}

#iht-lang-select option {
    background: #0a2e1a;
    color: #fff;
}

#iht-arrow {
    position: absolute;
    right: 10px;
    color: #00c060;
    font-size: 12px;
    pointer-events: none;
}

/* ── Status indicator ── */
#iht-status {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    min-width: 120px;
    text-align: left;
}

#iht-status.iht-loading {
    color: #f5b030;
}
#iht-status.iht-done {
    color: #00c060;
}
#iht-status.iht-error {
    color: #ff6b6b;
}

/* ── Spinner ── */
@keyframes iht-spin {
    to { transform: rotate(360deg); }
}
.iht-spinner {
    display: inline-block;
    width: 11px; height: 11px;
    border: 2px solid rgba(245,176,48,0.3);
    border-top-color: #f5b030;
    border-radius: 50%;
    animation: iht-spin 0.7s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

/* ── Push page content down so bar doesn't overlap ── */
body {
    padding-top: 44px !important;
}

/* Override for wp-admin bar */
body.admin-bar #iht-lang-bar {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar #iht-lang-bar {
        top: 46px;
    }
}

/* ── RTL for Arabic ── */
body.iht-rtl {
    direction: rtl;
    text-align: right;
}
body.iht-rtl #iht-lang-bar {
    justify-content: flex-start;
    flex-direction: row-reverse;
}
body.iht-rtl #iht-lang-inner {
    flex-direction: row-reverse;
}
body.iht-rtl #iht-status {
    text-align: right;
}

/* ── Translated text highlight (brief flash) ── */
@keyframes iht-flash {
    0%   { background: rgba(0,165,80,0.12); }
    100% { background: transparent; }
}
.iht-translated {
    animation: iht-flash 0.8s ease forwards;
    border-radius: 2px;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #iht-lang-select { min-width: 120px; font-size: 12px; }
    #iht-status      { display: none; }
    #iht-lang-bar    { padding: 0 12px; }
}
