/* ========== القواعد العامة ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0d1117;
    color: #e6edf3;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    min-height: 100vh;
}

/* ========== الحاوية الرئيسية ========== */
.container {
    width: 100%;
    max-width: 900px;
    margin: auto;
    padding: 1rem;
}

/* ========== الهيدر ========== */
.main-header {
    text-align: center;
    margin-top: 1.25rem;
    margin-bottom: 1.125rem;
}

.main-header h1 {
    color: #d2a8ff;
    font-size: 1.45rem;
    line-height: 1.8;
    font-weight: 800;
}

.main-header p {
    color: #9da7b3;
    margin-top: 0.625rem;
    font-size: 0.95rem;
}

/* ========== مسار التنقل (Breadcrumb) ========== */
.breadcrumb {
    margin-bottom: 0.5rem;
    color: #9da7b3;
    font-size: 0.85rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    gap: 0.4rem;
    padding: 0;
}

.breadcrumb a {
    color: #58a6ff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ========== البحث ========== */
.search-area {
    position: relative;
    margin-bottom: 0.875rem;
}

.search-area input {
    width: 100%;
    height: 52px;
    border: none;
    outline: none;
    border-radius: 12px;
    background: #161b22;
    color: #fff;
    padding: 0 50px 0 15px;
    font-size: 1rem;
    border: 1px solid #30363d;
    transition: border-color 0.2s ease;
}

.search-area input:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
}

.search-area button {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: #30363d;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-area button:hover {
    background: #444c56;
}

/* ========== الإحصائيات ========== */
.top-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
    color: #f0e68c;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ========== صف العناوين ========== */
.labels-row {
    display: grid;
    grid-template-columns: 1fr 65px 1.5fr;
    gap: 0.625rem;
    text-align: center;
    color: #f0e68c;
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

/* ========== شبكة الأسماء ========== */
#namesGrid {
    width: 100%;
    min-height: 300px;
}

.name-row {
    display: grid;
    grid-template-columns: 1fr 65px 1.5fr;
    gap: 0.625rem;
    align-items: center;
    margin-bottom: 0.875rem;
    animation: fadeUp 0.25s ease;
}

.plain-name,
.decorated-box {
    background: #1c2128;
    border: 1px solid #444c56;
    border-radius: 12px;
    padding: 0.8125rem 0.625rem;
    text-align: center;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: anywhere;
}

.plain-name {
    color: #ffffff;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.decorated-box {
    color: #58a6ff;
    border-color: #388bfd;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: normal;
    line-height: 1.6;
}

/* ========== زر النسخ ========== */
.copy-btn {
    width: 100%;
    height: 52px;
    border: none;
    outline: none;
    border-radius: 12px;
    cursor: pointer;
    background: #1c2128;
    border: 1px solid #444c56;
    color: #f0e68c;
    font-size: 1.2rem;
    transition: background 0.25s, transform 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: #30363d;
    transform: scale(1.03);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn:focus-visible {
    outline: 2px solid #58a6ff;
    outline-offset: 2px;
}

/* ========== زر عرض المزيد ========== */
.load-more-box {
    text-align: center;
    margin-top: 1.125rem;
    margin-bottom: 1.5625rem;
}

.load-more-box button {
    border: none;
    cursor: pointer;
    padding: 0.875rem 1.5625rem;
    border-radius: 12px;
    background: #238636;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    transition: opacity 0.25s, transform 0.25s;
}

.load-more-box button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.load-more-box button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ========== رسالة النسخ (Toast) ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #238636;
    color: #fff;
    padding: 0.75rem 1.375rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    display: none;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* ========== رسالة لا توجد نتائج ========== */
.no-results {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    color: #9da7b3;
    margin-top: 0.625rem;
}

/* ========== تأثير الظهور ========== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== تحسينات للجوال ========== */
@media (max-width: 700px) {
    .main-header h1 {
        font-size: 1.15rem;
    }

    .labels-row,
    .name-row {
        grid-template-columns: 1fr 58px 1.4fr;
        gap: 0.5rem;
    }

    .plain-name,
    .decorated-box,
    .copy-btn {
        min-height: 48px;
        font-size: 0.88rem;
    }

    .decorated-box {
        padding: 0.625rem 0.5rem;
    }

    .search-area input {
        height: 48px;
        font-size: 0.9rem;
    }
}