/* ==============================
   استایل پایه فرم ورود و عضویت (نسخه 3.2.3)
   [اصلاح شده برای واکنشگرایی و موقعیت‌یابی]
============================== */

/* کانتینر اصلی با افکت شیشه‌ای */
.ag-container {
    width: 100%; /* [جدید] برای واکنشگرایی بهتر در حالت flex */
    max-width: 420px; /* این توسط استایل داینامیک بازنویسی می‌شود */
    margin: 0;
    padding: 35px 40px; /* این توسط استایل داینامیک بازنویسی می‌شود */
    border-radius: 20px; /* این توسط استایل داینامیک بازنویسی می‌شود */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    direction: rtl;
    text-align: center;
    /* animation: float 6s ease-in-out infinite; [حذف شد] - انیمیشن شناور با موقعیت‌یابی تداخل داشت */
    z-index: 10;
    box-sizing: border-box; /* [جدید] برای محاسبات بهتر */
    /* Background, color, and backdrop-filter are now dynamic */
}

/* [حذف شد] - انیمیشن شناور حذف شد
@keyframes float {
	0% { transform: translatey(0px); }
	50% { transform: translatey(-10px); }
	100% { transform: translatey(0px); }
}
*/

/* تب‌ها */
.ag-tabs {
    display: flex;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 5px;
}
.ag-tab-link {
    flex: 1;
    padding: 12px 15px;
    cursor: pointer;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease-in-out;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ag-tab-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.ag-tab-link.active {
    background: #0d6efd; /* Default, can be overridden */
    color: #fff;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
}
.ag-tab-content { display: none; }
.ag-tab-content.active { display: block; }

.ag-form-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* اینپوت‌ها */
.ag-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 18px;
    border-width: 1px;
    border-style: solid;
    box-sizing: border-box;
    text-align: center;
    font-size: 16px;
    transition: all 0.3s ease;
    /* Background, color, border-color, and border-radius are now dynamic */
}

/* Placeholder color is now dynamic */
.ag-input::placeholder { color: #999; } /* Fallback */
.ag-input:-ms-input-placeholder { color: #999; } /* Fallback */
.ag-input::-ms-input-placeholder { color: #999; } /* Fallback */

.ag-input:focus {
    outline: none;
    /* Focus styles are now dynamic */
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5); /* Example glow */
}
#ag-otp-code {
    font-size: 24px;
    letter-spacing: 10px;
    font-weight: bold;
}

/* دکمه‌ها */
.ag-button {
    width: 100%;
    padding: 14px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    position: relative;
    overflow: hidden;
    /* Background, color, and border-radius are now dynamic */
}
.ag-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.5);
}
.ag-button:disabled {
    background: #555;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

/* لینک‌های کمکی */
.ag-resend-container {
    margin: 15px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}
#ag-resend-btn, #ag-back-btn {
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: all 0.2s ease;
    /* Colors are now dynamic */
}
#ag-resend-btn:hover, #ag-back-btn:hover {
    text-shadow: 0 0 10px #0dcaf0; /* Example glow */
}
#ag-back-btn { margin-top: 10px; }

/* پیام‌ها */
@keyframes bounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
.ag-message {
    padding: 15px;
    margin-top: 20px;
    border-radius: 10px;
    display: none;
    font-weight: 600;
    animation: bounceIn 0.5s ease-out;
    border: 1px solid;
    /* Background, color, and border-color are now dynamic */
}
.ag-success { border-color: rgba(25, 135, 84, 0.5); }
.ag-error { border-color: rgba(220, 53, 69, 0.5); }
.ag-info { border-color: rgba(13, 202, 240, 0.5); }


/* ==============================
 استایل صفحه پروفایل کاربری 
============================== */
.ag-profile-container {
    margin: 40px auto; padding: 30px; 
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    direction: rtl;
    /* Background and max-width are now dynamic */
}
.ag-profile-header { display: flex; align-items: center; border-bottom: 1px solid #e9ecef; padding-bottom: 20px; margin-bottom: 25px; }
.ag-profile-avatar-wrapper { position: relative; margin-left: 20px; }
.ag-profile-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid #f1f3f5; }
.ag-profile-avatar-uploader { position: absolute; bottom: 0; right: 0; width: 30px; height: 30px; background-color: #007bff; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid white; transition: background-color 0.2s; }
.ag-profile-avatar-uploader:hover { background-color: #0056b3; }
.ag-profile-header-info { text-align: right; }
.ag-profile-header-info h3 { margin: 0; font-size: 22px; font-weight: 600; /* Color is now dynamic */ }
.ag-profile-header-info p { margin: 5px 0 0; /* Color is now dynamic */ }
.ag-profile-section { margin-bottom: 30px; text-align: right; }
.ag-profile-section h4 { font-size: 18px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #e9ecef; /* Color is now dynamic */ }
.ag-profile-form .ag-form-row { display: flex; gap: 20px; margin-bottom: 15px; }
.ag-profile-form .ag-form-group { flex: 1; display: flex; flex-direction: column; margin-bottom: 15px; }
.ag-profile-form label { font-weight: 500; margin-bottom: 6px; font-size: 14px; color: #495057; }
.ag-profile-form .ag-input, .ag-profile-form .ag-button { 
    width: 100%; padding: 12px 15px; border: 1px solid #ced4da; border-radius: 8px; font-size: 15px; 
    transition: all 0.2s; box-sizing: border-box; background-color: #fff; color: #212529;
}
.ag-profile-form .ag-input:focus { border-color: #007bff; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15); outline: none; }
.ag-profile-form .ag-input[disabled] { background-color: #e9ecef; cursor: not-allowed; }
.ag-profile-form .ag-button { background-color: #28a745; color: white; border: none; cursor: pointer; font-weight: 600; }
.ag-profile-form .ag-button:hover { background-color: #218838; }

.ag-profile-tabs { display: flex; border-bottom: 2px solid #e9ecef; margin-bottom: 25px; }
.ag-profile-tabs .ag-profile-tab-link {
    padding: 10px 20px; cursor: pointer; text-decoration: none;
    font-weight: 600; border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out; margin-bottom: -2px;
    /* Colors are now dynamic */
}
.ag-profile-tabs .ag-profile-tab-link:hover { color: #007bff; /* Fallback */ }
.ag-profile-tab-content { display: none; }
.ag-profile-tab-content.active { display: block; animation: fadeIn 0.5s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ag-data-table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 14px; }
.ag-data-table th, .ag-data-table td { padding: 12px; border: 1px solid #e9ecef; text-align: right; }
.ag-data-table th { background-color: #f8f9fa; font-weight: 600; }
.ag-data-table tr:hover { background-color: #f1f3f5; }

/* استایل دکمه خروج */
.ag-logout-button {
    display: block; width: fit-content; margin: 40px auto 10px; padding: 10px 25px;
    background-color: #6c757d; color: white; text-decoration: none; border-radius: 8px;
    font-weight: 600; text-align: center; transition: all 0.2s ease-in-out;
}
.ag-logout-button:hover { background-color: #5a6268; color: white; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* کیف پول */
.ag-wallet-container { text-align: right; }
.ag-wallet-balance {
    background-color: #f8f9fa; border: 1px solid #e9ecef; padding: 20px;
    border-radius: 8px; margin-bottom: 25px; display: flex;
    justify-content: space-between; align-items: center;
}
.ag-wallet-balance span { font-size: 16px; color: #495057; }
.ag-wallet-balance strong { font-size: 22px; font-weight: 700; color: #28a745; }
.ag-wallet-container h4 { font-size: 18px; margin-bottom: 15px; }
.ag-wallet-deposit { color: #28a745 !important; font-weight: 500; }
.ag-wallet-withdraw { color: #dc3545 !important; font-weight: 500; }
.ag-profile-tabs .ag-profile-tab-link .dashicons { margin-left: 8px; vertical-align: middle; font-size: 20px; }

.ag-wallet-charge-section {
    border: 1px solid #e9ecef; padding: 20px; border-radius: 8px;
    margin: 30px 0; background: #fcfcfc;
}
.ag-wallet-charge-section h4 { margin-top: 0; }
.ag-wallet-charge-form { margin-top: 15px; }
.ag-wallet-charge-form .ag-form-group { margin-bottom: 15px; }
.ag-wallet-charge-form .ag-input { max-width: 300px; text-align: right; }
.ag-wallet-charge-form .ag-button { width: auto; padding: 10px 25px; }

/* ==============================
   مخفی‌سازی اولیه مودال
============================== */
.ag-modal-overlay,
.ag-modal-wrapper {
    display: none;
}