/* ============================================================
   RoSH Translator - Frontend Styles
   ============================================================ */

/* === زر تبديل اللغة العائم === */
.rosht-toggle-btn {
    position: fixed;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #1a5276, #2e86c1);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 4px 20px rgba(26, 82, 118, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}
.rosht-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26, 82, 118, 0.5);
}
.rosht-toggle-btn:active { transform: translateY(0); }

/* أعلام */
.rosht-flag { display: flex; align-items: center; }
.rosht-flag svg { border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* مواقع الزر */
.rosht-pos-bottom-left .rosht-toggle-btn { bottom: 24px; left: 24px; }
.rosht-pos-bottom-right .rosht-toggle-btn { bottom: 24px; right: 24px; }
.rosht-pos-top-left .rosht-toggle-btn { top: 80px; left: 24px; }
.rosht-pos-top-right .rosht-toggle-btn { top: 80px; right: 24px; }

/* النمط البسيط */
.rosht-minimal .rosht-toggle-btn {
    padding: 8px 12px;
    background: rgba(255,255,255,0.95);
    color: #1a5276;
    border: 2px solid #2e86c1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.rosht-minimal .rosht-toggle-btn:hover {
    background: #2e86c1;
    color: #fff;
}

/* === شريط التحميل === */
.rosht-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 999999;
    background: rgba(0,0,0,0.05);
}
.rosht-loading-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2e86c1, #3498db, #1abc9c);
    border-radius: 0 2px 2px 0;
    animation: rosht-load 2s ease-in-out infinite;
}
@keyframes rosht-load {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* === الإشعار === */
.rosht-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    background: #1a5276;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: rosht-toast-in 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@keyframes rosht-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === تأثير الانتقال على النصوص === */
.rosht-translating {
    opacity: 0.6;
    transition: opacity 0.3s;
}
.rosht-translated {
    opacity: 1;
    transition: opacity 0.3s;
}

/* === اتجاه الصفحة عند التبديل === */
body.rosht-ltr {
    direction: ltr !important;
    text-align: left !important;
}
body.rosht-ltr * {
    direction: ltr;
    text-align: left;
}
/* استثناءات - عناصر يجب أن تبقى كما هي */
body.rosht-ltr .rosht-toggle-btn,
body.rosht-ltr input,
body.rosht-ltr textarea,
body.rosht-ltr select,
body.rosht-ltr img {
    direction: ltr;
}

/* === Responsive === */
@media (max-width: 600px) {
    .rosht-toggle-btn { padding: 8px 12px; font-size: 12px; }
    .rosht-flag svg { width: 20px; height: 20px; }
    .rosht-pos-bottom-left .rosht-toggle-btn { bottom: 16px; left: 16px; }
    .rosht-pos-bottom-right .rosht-toggle-btn { bottom: 16px; right: 16px; }
    .rosht-toast { font-size: 13px; padding: 10px 18px; }
}
