/* =====================================================
   Iris Translator — Front-end styles
   Designed to sit naturally inside Divi / WordPress
   ===================================================== */

/* ── Language bar ── */
.iris-translator-bar {
    margin: 0 0 8px;
    padding: 0;
    font-family: inherit;
}

.iris-translator-bar__inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
    background: #f0f7fb;
    border: 1px solid #c6dfe9;
    border-radius: 8px;
}

.iris-translator-bar__label {
    font-size: 13px;
    font-weight: 600;
    color: #3a6f88;
    white-space: nowrap;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.iris-translator-bar__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Language tab buttons ── */
.iris-lang-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    font-size: 13px;
    font-weight: 500;
    color: #3a6f88;
    background: #ffffff;
    border: 1.5px solid #c6dfe9;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1.4;
    font-family: inherit;
}

.iris-lang-tab:hover {
    background: #62bcd9;
    border-color: #62bcd9;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(98, 188, 217, 0.35);
}

.iris-lang-tab:focus-visible {
    outline: 2px solid #62bcd9;
    outline-offset: 2px;
}

.iris-lang-tab--active {
    background: #62bcd9;
    border-color: #62bcd9;
    color: #ffffff;
    font-weight: 600;
}

.iris-lang-tab--active:hover {
    background: #4dabc8;
    border-color: #4dabc8;
    transform: none;
    box-shadow: none;
}

.iris-lang-tab--loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* ── Status bar ── */
.iris-translator-status {
    font-size: 12px;
    color: #666;
    padding: 0 14px 8px;
    min-height: 20px;
    transition: opacity 0.3s;
}

.iris-translator-status:empty {
    display: none;
}

.iris-translator-status--error {
    color: #c0392b;
}

/* ── Translated content wrapper ── */
.iris-translated-content {
    display: none;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #fafeff;
    border: 1px solid #d6eef6;
    border-radius: 8px;
    position: relative;
    animation: iris-fade-in 0.25s ease;
}

.iris-translated-content.iris-visible {
    display: block;
}

.iris-translated-content__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d6eef6;
}

.iris-translated-content__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #3a6f88;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.iris-translated-content__badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.iris-translated-content__cache-badge {
    font-size: 11px;
    color: #1a7f37;
    background: #e6f4ea;
    border-radius: 10px;
    padding: 2px 8px;
}

.iris-translated-content__body p {
    margin-bottom: 1em;
    line-height: 1.7;
    color: #2c2c2c;
}

.iris-translated-content__body p:last-child {
    margin-bottom: 0;
}

/* ── DeepL attribution ── */
.iris-deepl-credit {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eef5f8;
    font-size: 11px;
    color: #999;
    text-align: right;
}

.iris-deepl-credit a {
    color: #0f7dc7;
    text-decoration: none;
}

.iris-deepl-credit a:hover {
    text-decoration: underline;
}

/* ── Skeleton loader ── */
.iris-skeleton {
    animation: iris-shimmer 1.4s infinite linear;
    background: linear-gradient(90deg, #e8f4f8 25%, #d6ecf4 50%, #e8f4f8 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    height: 1em;
    margin-bottom: 10px;
}

.iris-skeleton:nth-child(2) { width: 90%; }
.iris-skeleton:nth-child(3) { width: 96%; }
.iris-skeleton:nth-child(4) { width: 82%; }
.iris-skeleton:nth-child(5) { width: 94%; }
.iris-skeleton:nth-child(6) { width: 70%; }

/* ── Animations ── */
@keyframes iris-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes iris-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .iris-translator-bar__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .iris-lang-tab {
        font-size: 12px;
        padding: 4px 11px;
    }

    .iris-translated-content {
        padding: 14px 16px;
    }
}
