/* --- Global Variables & Reset --- */
:root {
    --bg-color: #f8f9fa;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --bg-surface: #ffffff;
    --primary-color: #212529;
    --primary-hover: #343a40;
    --link-color: #0d6efd;
    --link-hover: #0a58ca;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* --- Navigation Bar --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-light);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.badge {
    background: var(--border-light);
    color: #495057;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lang-btn {
    background: var(--bg-color);
    border: 1px solid #ced4da;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    transition: background-color 0.2s;
}

.lang-btn:hover {
    background: var(--border-light);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* --- Overlay (Drag & Drop) --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(33, 37, 41, 0.9);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
    color: #fff;
}

.overlay.active {
    opacity: 1;
}

.arrows {
    font-size: 32px;
    letter-spacing: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

kbd {
    background: #495057;
    border: 1px solid var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    margin: 0 4px;
}

.hint-text {
    margin-top: 20px;
    color: #adb5bd;
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: bottom 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    pointer-events: none;
}

.toast.show {
    bottom: 30px;
}

/* --- Language Select Dropdown --- */
.lang-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-main);
    font-family: var(--font-family);
    cursor: pointer;
    outline: none;
    transition: 0.2s;
    appearance: none;
    /* إخفاء السهم الافتراضي في بعض المتصفحات */
    padding-inline-end: 24px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

[dir="rtl"] .lang-select {
    background-position: left 8px center;
}

.lang-select:hover {
    background-color: var(--bg-color);
}

.lang-select:focus {
    border-color: var(--primary-color);
}

/* --- Visually Hidden (For Drag & Drop Real Names) --- */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}