/* --- فونت فارسی --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

body {
    font-family: "Vazirmatn", sans-serif;
}

/* --- استایل‌های کلی جعبه‌ها --- */
.msp-login-box, .msp-welcome-box {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    padding: 40px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,115,170,0.3);
    margin-bottom: 30px;
}

.msp-welcome-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
}
.msp-welcome-box h2 { margin: 0; }
.msp-welcome-box p { margin: 5px 0 0 0; opacity: 0.9; }

.msp-logout-btn {
    background: #fff;
    color: #0073aa;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}
.msp-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.3);
}

.msp-login-box h2 { margin-top: 0; font-size: 28px; }

.msp-login-form input[type="text"],
.msp-login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: "Vazirmatn", sans-serif;
    text-align: right;
}
.msp-login-form input[type="submit"] {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #0073aa;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.msp-login-form input[type="submit"]:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255,255,255,0.3);
}
.msp-login-form input[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }

.msp-login-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}
.msp-login-message.msp-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.msp-login-message.msp-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* --- استایل جستجو --- */
.msp-search-container {
    margin-bottom: 20px;
}
#msp-search-input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: right;
    transition: border-color 0.3s;
}
#msp-search-input:focus {
    border-color: #0073aa;
    outline: none;
}

/* --- استایل جدول پیام‌ها --- */
.msp-table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    overflow: hidden;
}
.msp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.msp-table th {
    background: #f7f7f7;
    color: #333;
    font-weight: 600;
    padding: 15px;
    text-align: right;
    border-bottom: 2px solid #eee;
}
.msp-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.msp-row:hover { background-color: #f9f9f9; }
.msp-row:last-child td { border-bottom: none; }

.msp-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}
.status-new { background-color: #ff4d4d; color: #fff; animation: pulse-new 2s infinite; }
.status-read { background-color: #e0e0e0; color: #333; }
@keyframes pulse-new {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

.msp-view-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.msp-view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.msp-no-messages {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 18px;
}

/* --- استایل مودال (پنجره پاپ‌آپ) --- */
.msp-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.4s;
}
.msp-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    animation: slideIn 0.5s;
    direction: rtl;
}
.msp-close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}
.msp-close:hover { color: #000; }
.msp-modal-content h3 {
    margin-top: 0;
    color: #0073aa;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.msp-modal-content table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}
.msp-modal-content table td:first-child {
    font-weight: bold;
    width: 30%;
}
@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideIn { from {transform: translateY(-50px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }
/* استایل برای پیام لودینگ و خطا */
.msp-loading, .msp-no-messages {
    text-align: center;
    padding: 30px;
    font-size: 18px;
    color: #888;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}