/* ====================== فونت وزیر با اولویت بالا ====================== */
@font-face {
  font-family: 'vazir';
  src: url('fonts/Vazir-Regular.woff2') format('woff2');
  font-weight: 400;
}

@font-face {
  font-family: 'vazir';
  src: url('fonts/Vazir-Medium.woff2') format('woff2');
  font-weight: 500;
}

@font-face {
  font-family: 'vazir';
  src: url('fonts/Vazir-Bold.woff2') format('woff2');
  font-weight: 700;
}

/* اعمال فونت به همه المان‌ها */
*, body, h1, h2, h3, input, button, span, div, p, strong {
    font-family: 'vazir', Tahoma, Arial, sans-serif !important;
}

/* ====================== پایه ====================== */
body {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e0e0e0;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    justify-content: center; /* وسط افقی */
    align-items: center;     /* وسط عمودی */

}

/* ====================== صفحه لاگین (index.php) ====================== */

.login-box {
    background: rgba(30, 30, 46, 0.97);
    padding: 50px 30px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #00d4ff, #7b68ee);
    color: white;
    font-size: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.login-box h2 {
    font-size: 26px;
    margin-bottom: 10px;
    color: #fff;
}

.subtitle {
    color: #b0b0d0;
    margin-bottom: 35px;
    font-size: 15.5px;
}

.login-box input {
    width: 100%;
    padding: 16px 20px;
    margin: 12px 0;
    background: rgba(45, 45, 68, 0.95);
    border: 2px solid rgba(110, 120, 180, 0.5);
    border-radius: 16px;
    color: #fff;
    font-size: 16.5px;
    box-sizing: border-box;
}

.login-box input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2);
}

.btn-start {
    width: 100%;
    padding: 16px;
    margin-top: 25px;
    background: linear-gradient(135deg, #00d4ff, #7b68ee);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 17.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-start:hover {
    transform: translateY(-3px);
}

/* ====================== چت باکس (فیکس و responsive) ====================== */
.chat-box {
    position: fixed; /* مهم */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    max-width: 760px;
    margin: 0 auto;

    height: 100dvh; /* بهتر از vh برای موبایل */
    display: flex;
    flex-direction: column;

    background: rgba(25, 25, 40, 0.98);
    overflow: hidden;
}
.chat-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 16px 20px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #0f0c29;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15.8px;
    line-height: 1.55;
    position: relative;
    display: inline-block;
    word-wrap: break-word;
}

.user {
    align-self: flex-start;
    background: #1e2a44;
    color: #c0d4ff;
    border-bottom-left-radius: 5px;
}

.admin {
    align-self: flex-end;
    background: linear-gradient(135deg, #6e56cf, #00d4ff);
    color: white;
    border-bottom-right-radius: 5px;
}

.msg strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    opacity: 0.9;
}

.msg small {
    display: block;
    margin-top: 7px;
    font-size: 11.5px;
    opacity: 0.8;
}

/* کپی باتن */
.copy-btn {
    position: absolute;
    bottom: -19px;
    opacity: 1;
    background: rgba(0,0,0,0.8);
    color: #fff;
    border: none;
    border-radius: 40%;
    width: 40px;
    height: 40px;
    font-size: 11px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #00d4ff;
}

.user .copy-btn { right: 10px; }
.admin .copy-btn { left: 10px; }

/* ورودی چت - همیشه پایین */
.input-area {
    padding: 15px 20px;
    background: #1a1a2e;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

#message-input {
    flex: 1;
    padding: 15px 20px;
    background: #25253a;
    border: 2px solid #3a3a5c;
    border-radius: 50px;
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
    font-size: 16px !important;           /* خیلی مهم */
    -webkit-appearance: none;
    appearance: none;

}

#message-input:focus {
    border-color: #00d4ff;
}

#send-btn {
    padding: 0 26px;
    background: linear-gradient(135deg, #00d4ff, #7b68ee);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
}
/* ====================== داشبورد ادمین - لیست کاربران ====================== */
.user-list {
    list-style: none;
    padding: 15px;
    max-height: calc(100vh - 120px);   /* مهم: ارتفاع ثابت با اسکرول */
    overflow-y: auto;
    margin: 0;
}

.user-item {
    background: rgba(40, 40, 65, 0.95);
    padding: 18px 20px;
    margin: 10px 0;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:hover {
    background: rgba(60, 60, 95, 0.98);
    transform: translateX(6px);
}

.user-info strong {
    font-size: 16.5px;
    display: block;
    margin-bottom: 4px;
}

.last-time {
    color: #aaa;
    font-size: 13.5px;
}

.unread {
    background: #ff3b5c;
    color: white;
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
input, textarea {
    font-size: 16px !important;
}

html, body {
    height: 100%;
    overflow: hidden; /* حذف کامل اسکرول صفحه */
}
body {
    position: fixed;
    width: 100%;
}
.input-area {
    position: sticky;
    bottom: 0;
}
.login-container {
    width: 100%;
    max-width: 380px;
    margin: auto; /* کمک برای وسط شدن */
    transform: translateX(15px); /* عدد رو تغییر بده */
}
