/* DG Arabic Translator — Frontend Styles */

/* ── Arabic Font ─────────────────────────────────────────── */
.dgat-rtl,
.dgat-rtl * {
    font-family: 'Tajawal', 'Arial', sans-serif !important;
}

/* ── Switcher Container ──────────────────────────────────── */
#dgat-switcher {
    position: fixed;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.08);
    padding: 4px;
    transition: box-shadow 0.2s ease;
    border: 1px solid rgba(0,0,0,0.06);
}

#dgat-switcher:hover {
    box-shadow: 0 6px 28px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Positions ───────────────────────────────────────────── */
.dgat-pos-bottom-right { bottom: 24px; right: 24px; }
.dgat-pos-bottom-left  { bottom: 24px; left:  24px; }
.dgat-pos-top-right    { top:    24px; right: 24px; }
.dgat-pos-top-left     { top:    24px; left:  24px; }

/* ── Language Buttons ────────────────────────────────────── */
.dgat-lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    letter-spacing: 0.5px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
    outline: none;
    font-family: inherit;
    line-height: 1;
}

.dgat-lang-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.dgat-lang-btn:active {
    transform: scale(0.96);
}

.dgat-lang-btn.dgat-active {
    background: #006C35;  /* UAE green */
    color: #fff;
}

.dgat-flag {
    font-size: 16px;
    line-height: 1;
}

.dgat-lang-label {
    font-size: 12px;
    font-weight: 700;
}

/* ── Divider ─────────────────────────────────────────────── */
.dgat-divider {
    width: 1px;
    height: 22px;
    background: #e0e0e0;
    flex-shrink: 0;
}

/* ── Loading Spinner ─────────────────────────────────────── */
.dgat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.dgat-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #006C35;
    border-radius: 50%;
    animation: dgat-spin 0.7s linear infinite;
    display: block;
}

@keyframes dgat-spin {
    to { transform: rotate(360deg); }
}

/* ── Toast Notification ──────────────────────────────────── */
.dgat-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100000;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.dgat-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dgat-toast-error {
    background: #c0392b;
}

/* ── RTL Global Overrides ────────────────────────────────── */
.dgat-rtl {
    direction: rtl;
    text-align: right;
}

/* Common layout elements that need flipping */
.dgat-rtl .alignleft  { float: right !important; }
.dgat-rtl .alignright { float: left  !important; }

.dgat-rtl input[type="text"],
.dgat-rtl input[type="email"],
.dgat-rtl input[type="password"],
.dgat-rtl textarea {
    direction: rtl;
    text-align: right;
}

/* Margins/paddings that are direction-aware */
.dgat-rtl .wp-block-columns {
    flex-direction: row-reverse;
}

/* Navigation menus */
.dgat-rtl .nav-menu,
.dgat-rtl .menu {
    direction: rtl;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .dgat-pos-bottom-right { bottom: 16px; right: 16px; }
    .dgat-pos-bottom-left  { bottom: 16px; left:  16px; }
    .dgat-pos-top-right    { top:    16px; right: 16px; }
    .dgat-pos-top-left     { top:    16px; left:  16px; }

    .dgat-lang-btn {
        padding: 6px 10px;
    }
}
