* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    padding: 40px 20px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.header h1 {
    font-size: 2.2em;
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    display: inline-block;
    padding: 10px 28px;
    background: #b00020;
    border-radius: 999px;
}

.header-sub-pill {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 20px;
    background: #ffffff;
    color: #111111;
    border-radius: 999px;
    font-size: 0.9em;
}

.header p {
    color: #888;
    font-size: 0.95em;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.stat-box {
    text-align: center;
}

.stat-box .number {
    font-size: 2.5em;
    color: #ffffff;
    font-weight: 300;
    display: block;
    margin-bottom: 5px;
}

.stat-box .label {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls {
    padding: 25px 20px;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 18px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
    transition: all 0.2s;
}

.search-box input::placeholder {
    color: #555;
}

.search-box input:focus {
    outline: none;
    border-color: #444;
    background: #1f1f1f;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #aaa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
    font-weight: 400;
}

.filter-btn:hover {
    background: #222;
    border-color: #333;
    color: #fff;
}

.filter-btn.active {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.name-card {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.name-card:hover {
    border-color: #3a3a3a;
    background: #181818;
}

.name-card .letter-badge {
    display: inline-block;
    background: #2a2a2a;
    color: #aaa;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 15px;
}

.name-card .number {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.name-card .name {
    font-size: 1.15em;
    color: #ffffff;
    margin-bottom: 18px;
    line-height: 1.5;
    font-weight: 400;
}

.name-card .info-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.name-card .info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.name-card .info-label {
    color: #666;
    min-width: 80px;
    font-size: 0.85em;
}

.name-card .info-value {
    color: #ccc;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.name-card .id-toggle {
    padding: 4px 10px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #aaa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
}

.name-card .id-toggle:hover {
    background: #222;
    border-color: #333;
    color: #fff;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #666;
    font-size: 1.1em;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
    }

    .header {
        padding: 25px 15px;
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 1.5em;
        margin-bottom: 8px;
    }

    .header p {
        font-size: 0.85em;
    }

    .stats {
        gap: 25px;
        margin-top: 20px;
    }

    .stat-box .number {
        font-size: 2em;
    }

    .stat-box .label {
        font-size: 0.75em;
    }

    .controls {
        padding: 20px 15px;
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }

    .search-box input {
        padding: 14px 16px;
        font-size: 16px; /* يمنع zoom في iOS */
    }

    .filter-buttons {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }

    .filter-btn {
        padding: 10px 14px;
        font-size: 0.85em;
        flex: 1;
        min-width: 40px;
        max-width: 50px;
    }

    .names-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
    }

    .name-card {
        padding: 18px;
    }

    .name-card .letter-badge {
        width: 28px;
        height: 28px;
        font-size: 0.8em;
        margin-bottom: 12px;
    }

    .name-card .number {
        font-size: 0.75em;
        margin-bottom: 10px;
    }

    .name-card .name {
        font-size: 1.05em;
        margin-bottom: 15px;
        line-height: 1.4;
    }

    .name-card .info-item {
        font-size: 0.85em;
        flex-wrap: wrap;
    }

    .name-card .info-label {
        min-width: 70px;
        font-size: 0.8em;
    }

    .name-card .info-value {
        font-size: 0.85em;
        word-break: break-all;
    }

    .no-results {
        padding: 60px 15px;
        font-size: 1em;
    }
}

/* Small Mobile (أقل من 480px) */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .header {
        padding: 20px 12px;
    }

    .header h1 {
        font-size: 1.3em;
    }

    .stats {
        gap: 20px;
        flex-direction: column;
    }

    .stat-box .number {
        font-size: 1.8em;
    }

    .controls {
        padding: 15px 12px;
    }

    .filter-btn {
        padding: 8px 10px;
        font-size: 0.8em;
        max-width: 45px;
    }

    .name-card {
        padding: 15px;
    }

    .name-card .name {
        font-size: 1em;
    }

    .name-card .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .name-card .info-label {
        min-width: auto;
    }
}
