/* --- General & Variables --- */
:root {
    --mplc-primary: #0073aa;
    --mplc-secondary: #f0f0f1;
    --mplc-text: #3c434a;
    --mplc-white: #fff;
    --mplc-border: #ddd;
    --mplc-success: #4CAF50;
    --mplc-danger: #f44336;
    --mplc-info: #2196F3;
    --mplc-warning: #ffc107;
    --mplc-positive-bg: #e8f5e9;
    --mplc-negative-bg: #ffebee;
    --mplc-positive-border: #a5d6a7;
    --mplc-negative-border: #ef9a9a;
    --mplc-positive-icon: #388e3c;
    --mplc-negative-icon: #d32f2f;
}

#mplc-lookup-container {
    max-width: 700px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--mplc-text);
    direction: rtl;
}

/* --- Search Box --- */
.mplc-search-box {
    display: flex;
    border: 1px solid var(--mplc-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    background-color: var(--mplc-white);
    transition: all 0.3s ease-in-out;
    position: relative;
    z-index: 998;
}

/* --- Floating Search Box --- */
.mplc-search-box.mplc-floating {
    position: fixed !important;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    z-index: 9999 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
}
.mplc-search-box-placeholder {
    display: none;
}

#mplc-phone-input {
    flex-grow: 1;
    border: none;
    padding: 15px;
    font-size: 1.1em;
    outline: none;
    background: transparent;
}
#mplc-search-button {
    background-color: var(--mplc-primary);
    color: var(--mplc-white);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    border-radius: 0; /* Remove radius to fit next to new button */
}
#mplc-search-button:hover { background-color: #005a87; }
#mplc-search-button:disabled { background-color: #a0a5aa; cursor: not-allowed; }

/* --- WhatsApp Share Button --- */
#mplc-whatsapp-share-button {
    background-color: #25D366; /* WhatsApp Green */
    color: var(--mplc-white);
    border: none;
    padding: 0 15px; /* Slightly less padding than search */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    border-right: 1px solid rgba(255, 255, 255, 0.2); /* Separator line */
}

#mplc-whatsapp-share-button:hover {
    background-color: #1DA851; /* Darker green on hover */
}

/* --- Views (Suggestions & Details) --- */
.mplc-view {
    margin-top: 20px;
    padding: 20px;
    background: var(--mplc-white);
    border: 1px solid var(--mplc-border);
    border-radius: 8px;
}
.mplc-view-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 15px;
}

/* --- REVISED: Suggestion Styling for Name Search --- */
.mplc-suggestions-list { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.mplc-suggestion-btn:hover { 
    background-color: #e0e1e2; 
    border-color: #ccc; 
}

.mplc-suggestion-name {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--mplc-primary);
    margin-bottom: 4px;
}

.mplc-suggestion-name strong {
    background-color: var(--mplc-warning);
    padding: 0 2px;
    border-radius: 2px;
    color: #333;
}

.mplc-suggestion-number {
    font-size: 0.95em;
    color: #555;
    direction: ltr;
    text-align: left;
    width: 100%;
}

.mplc-suggestion-extra-data {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.mplc-suggestion-extra-data.mplc-suggestion-groups {
    font-style: italic;
}


/* --- Not Found View --- */
.mplc-not-found { text-align: center; padding: 1rem; }
.mplc-not-found-icon { font-size: 3rem; margin-bottom: 1rem; }
.mplc-not-found h3 { margin: 0 0 0.5rem 0; font-size: 1.5rem; }
.mplc-not-found h3 span { color: var(--mplc-primary); }
.mplc-not-found p { color: #666; margin-bottom: 1.5rem; }
#mplc-not-found-form { max-width: 500px; margin: 0 auto 1.5rem; }
#mplc-not-found-form input {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
#mplc-not-found-form button {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.1rem;
    font-weight: bold;
    background-color: var(--mplc-success);
    color: var(--mplc-white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Profile Page Specifics --- */
.mplc-profile-page .mplc-details-header {
    padding-bottom: 5px;
    margin-bottom: 5px;
    border-bottom: none;
    text-align: center;
}
.mplc-profile-page .mplc-details-header h1 {
    font-size: 2.5em;
    margin: 0;
    color: var(--mplc-primary);
}
.mplc-search-counter {
    text-align: center;
    font-size: 1.2em;
    color: #555;
    background: var(--mplc-secondary);
    padding: 8px;
    border-radius: 8px;
    margin: 0 auto 20px;
    max-width: 400px;
}
.mplc-search-counter span {
    font-weight: bold;
    color: var(--mplc-danger);
}
.mplc-share-section {
    margin-bottom: 20px;
}
#mplc-share-button {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    background-color: var(--mplc-success);
    color: var(--mplc-white);
    border: none;
    border-radius: 8px;
}
.mplc-profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    text-align: center;
}
.mplc-stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.mplc-stat-item strong {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--mplc-primary);
}
.mplc-stat-item span {
    font-size: 0.9em;
    color: #6c757d;
}
.mplc-stat-item.mplc-strength-meter strong {
    color: var(--mplc-success);
}
.mplc-additional-info-box {
    background: var(--mplc-warning);
    color: #5b4600;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* --- Details View --- */
.mplc-details-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.mplc-details-header h2 { margin: 0; font-size: 1.8em; color: var(--mplc-primary); }
.mplc-counter { background-color: var(--mplc-secondary); padding: 5px 10px; border-radius: 15px; font-size: 0.9em; }
.mplc-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.mplc-section:last-child { margin-bottom: 0; }
.mplc-section h3 {
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid;
}
#reputation-section { background-color: #f8f9fa; }
#reputation-section h3 { border-color: #ced4da; }
#names-section { background-color: #fff; }
#names-section h3 { border-color: var(--mplc-primary); }
.mplc-section ul { list-style: none; padding: 0; margin: 0; }
.mplc-section ul li { padding: 10px; border-radius: 4px; margin-bottom: 8px; background-color: var(--mplc-secondary); }
.mplc-ltr { direction: ltr; text-align: left; }

/* --- Info Notice --- */
.mplc-info-notice {
    background-color: var(--mplc-info);
    color: var(--mplc-white);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}
.mplc-info-notice p { margin: 0; }

/* --- Names List with Report Button --- */
.mplc-name-item { display: flex; justify-content: space-between; align-items: center; }
.mplc-name-text { flex-grow: 1; }
.mplc-report-name-btn { background: none; border: none; cursor: pointer; padding: 5px; opacity: 0.5; transition: opacity 0.3s; }
.mplc-report-name-btn:hover { opacity: 1; color: var(--mplc-danger); }
.mplc-report-name-btn svg { display: block; }

/* --- Suggest Name Section --- */
.mplc-suggest-name-form { display: flex; gap: 10px; margin-top: 1rem; }
#mplc-suggest-name-input { flex-grow: 1; padding: 10px; border: 1px solid var(--mplc-border); border-radius: 4px; }
#mplc-submit-new-name {
    background-color: var(--mplc-primary);
    color: var(--mplc-white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0 20px;
}

/* --- Groups List --- */
.mplc-groups-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mplc-group-tag { background: #e9ecef; color: #495057; padding: 5px 12px; border-radius: 15px; font-size: 0.9em; }

/* --- Reputation Section --- */
.mplc-rep-counters { display: flex; justify-content: space-around; margin-bottom: 1rem; }
.mplc-rep-box { text-align: center; padding: 10px 20px; border-radius: 8px; width: 45%; }
.mplc-rep-positive { background-color: var(--mplc-positive-bg); border: 1px solid var(--mplc-positive-border); color: var(--mplc-positive-icon); }
.mplc-rep-negative { background-color: var(--mplc-negative-bg); border: 1px solid var(--mplc-negative-border); color: var(--mplc-negative-icon); }
.mplc-rep-count { display: block; font-size: 2em; font-weight: bold; }
.mplc-add-reputation-section h3 { border-color: #6c757d; }
.mplc-rep-input-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.mplc-rep-name-input, .mplc-rep-comment-input { width: 100%; padding: 10px; border: 1px solid var(--mplc-border); border-radius: 4px; box-sizing: border-box; }
.mplc-rep-comment-input { min-height: 70px; }
.mplc-rep-buttons { display: flex; gap: 10px; }
.mplc-rep-btn {
    flex-grow: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.mplc-rep-btn:hover { opacity: 0.9; }
.mplc-rep-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.mplc-rep-btn-positive { background-color: var(--mplc-positive-icon); }
.mplc-rep-btn-negative { background-color: var(--mplc-negative-icon); }
.mplc-comments-list { list-style: none; padding: 0; margin-top: 15px; }
.mplc-comment { background: var(--mplc-white); border-right: 4px solid var(--mplc-border); padding: 10px 15px; margin-bottom: 10px; border-radius: 4px; }
.mplc-comment-positive { border-right-color: var(--mplc-positive-icon); }
.mplc-comment-negative { border-right-color: var(--mplc-negative-icon); }
.mplc-comment p { margin: 0 0 5px 0; }
.mplc-comment small { color: #777; }

/* --- Owner Actions Section --- */
.mplc-owner-actions { display: flex; gap: 10px; margin-top: 1.5rem; border: none; padding: 0; }
.mplc-action-btn {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid;
    background: transparent;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 1em;
}
.mplc-action-btn:disabled { background-color: #a0a5aa; }
.mplc-removal-btn { color: var(--mplc-danger); border-color: var(--mplc-danger); }
.mplc-removal-btn:hover { background-color: var(--mplc-danger); color: var(--mplc-white); }

/* --- Modal --- */
#mplc-contribution-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
#mplc-modal-content { background: var(--mplc-white); padding: 30px; border-radius: 8px; width: 90%; max-width: 500px; text-align: center; }
#mplc-modal-content h2 { margin-top: 0; }
#mplc-modal-content p { color: #555; line-height: 1.6; }
#mplc-visitor-phone-input { width: 100%; padding: 12px; font-size: 1.1em; border: 1px solid var(--mplc-border); border-radius: 4px; margin-top: 15px; margin-bottom: 15px; box-sizing: border-box; }
#mplc-submit-visitor-number { width: 100%; padding: 12px; font-size: 1.1em; background: var(--mplc-primary); color: var(--mplc-white); border: none; border-radius: 4px; cursor: pointer; }

/* --- Utilities --- */
.mplc-spinner {
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--mplc-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: mplc-spin 1s linear infinite;
    margin: 2rem auto;
}
.mplc-spinner-small { width: 20px; height: 20px; border-width: 2px; margin: 0; }
.mplc-message { padding: 1rem; border-radius: 6px; text-align: center; }
.mplc-message.mplc-error { background: #f8d7da; color: #721c24; }
.mplc-message.mplc-info { background: #d1ecf1; color: #0c5460; }

@keyframes mplc-spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
    .mplc-profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .mplc-search-box.mplc-floating {
        width: 95%;
    }
}

/* ... (كل التنسيقات السابقة كما هي) ... */

/* --- بداية التنسيقات الجديدة --- */

/* --- بطاقة حالة الرقم (Warning Card) --- */
.mplc-status-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    color: #fff;
    border: 2px solid rgba(0,0,0,0.1);
}
.mplc-status-icon {
    font-size: 3em;
    margin-left: 20px;
    line-height: 1;
}
.mplc-status-text h4 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
}
.mplc-status-danger {
    background-color: #f44336; /* أحمر للخطر */
}
.mplc-status-warning {
    background-color: #ffc107; /* أصفر للمشبوه */
    color: #333;
}
.mplc-status-safe {
    background-color: #4CAF50; /* أخضر للآمن */
}
.mplc-status-neutral {
    background-color: #607d8b; /* رمادي للمحايد */
}

/* --- قائمة الأرقام المبلغ عنها --- */
.mplc-reported-list-container {
    margin-top: 40px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
}
.mplc-reported-list-container h3 {
    margin-top: 0;
    text-align: center;
    color: var(--mplc-primary);
}
.mplc-reported-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mplc-reported-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "number count" "name count";
    gap: 5px 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mplc-reported-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.mplc-reported-number {
    grid-area: number;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--mplc-primary);
    direction: ltr;
    text-align: right;
}
.mplc-reported-name {
    grid-area: name;
    font-size: 0.9em;
    color: #666;
}
.mplc-reported-count {
    grid-area: count;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--mplc-danger);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    text-align: center;
}
.mplc-reported-count span {
    font-size: 1.4em;
    font-weight: bold;
    display: block;
}

/* --- ترقيم الصفحات --- */
.mplc-pagination {
    margin-top: 20px;
    text-align: center;
}
.mplc-pagination .page-numbers {
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--mplc-primary);
    text-decoration: none;
    border-radius: 4px;
}
.mplc-pagination .page-numbers.current {
    background: var(--mplc-primary);
    color: #fff;
    border-color: var(--mplc-primary);
}
.mplc-pagination .page-numbers:hover {
    background: #f0f0f1;
}
.mplc-pagination .page-numbers.current:hover {
    background: var(--mplc-primary);
}

/* --- تعديل بسيط على كلاسات التعليقات --- */
.mplc-comment-report { border-right-color: var(--mplc-negative-icon); }
.mplc-comment-safe { border-right-color: var(--mplc-positive-icon); }
/* --- تنسيق زر التبليغ السريع --- */
.mplc-suggestion-item {
    display: flex;
    align-items: stretch; /* لجعل الأزرار بنفس الارتفاع */
    gap: 5px;
    margin-bottom: 10px;
}

.mplc-suggestion-item .mplc-suggestion-btn {
    flex-grow: 1; /* زر التفاصيل يأخذ معظم المساحة */
    text-align: right;
}

.mplc-quick-report-btn {
    flex-shrink: 0;
    background-color: #fbe9e7; /* خلفية حمراء باهتة */
    color: #c62828; /* لون أحمر داكن */
    border: 1px solid #ffccbc;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mplc-quick-report-btn:hover {
    background-color: #ffccbc;
    color: #b71c1c;
}

.mplc-quick-report-btn.reporting {
    background-color: #eceff1;
    color: #546e7a;
    cursor: wait;
}

.mplc-quick-report-btn.reported {
    background-color: #e8f5e9; /* أخضر */
    color: #2e7d32;
    border-color: #a5d6a7;
    cursor: not-allowed;
}

.mplc-quick-report-btn.reported svg {
    display: none; /* إخفاء الأيقونة بعد التبليغ */
}
 
/* --- نهاية التنسيقات الجديدة --- */
