* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #F0F8FF, #FFFFFF);
    color: #1C1C2E;
    line-height: 1.6;
    direction: rtl;
    transition: all 0.3s ease;
}

a {
    text-decoration: none;
    color: #1E88E5;
    transition: all 0.3s ease;
}

a:hover {
    color: #FF7043;
    text-shadow: 0 0 4px rgba(255,112,67,0.6);
}


h1,h2,h3,h4,h5,h6 {
    color: #0B3D91;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
header {
    background: linear-gradient(90deg, #1E88E5, #64B5F6);
    padding: 22px 0;
    color: #fff;
    border-radius: 12px 12px 0 0;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    position: relative;
    z-index: 10;
}

nav {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

nav .divTableRow, nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

nav .divTableCell {
    margin: 8px 14px;
    padding: 14px 28px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    white-space: nowrap; 
}

nav .divTableCell a {
    color: #1E88E5;
    font-weight: 700;
}

nav .divTableCell:hover {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(135deg, #1E88E5, #64B5F6);
}

nav .divTableCell:hover a {
    color: #fff;
}

.divTable, table {
    display: table;
    width: 100%;
    max-width: 1200px;
    margin: 28px auto;
    border-collapse: collapse;
    font-size: 15pt;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.divTableRow, tr {
    display: table-row;
}

.divTableCell, td {
    display: table-cell;
    border: 1px solid #e0e0e0;
    padding: 18px 24px;
    vertical-align: middle;
    text-align: center;
    transition: all 0.3s ease;
}

.divTableCell img, td img {
    max-width: 120px;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.divTableCell img:hover, td img:hover {
    transform: scale(1.08);
    box-shadow: 0 14px 30px rgba(0,0,0,0.25);
}

.divTableRow:nth-child(even), tr:nth-child(even) {
    background-color: #E8F3FF;
}

/* چت */
#chat-container {
    display: flex;
    width: 95%; /* کمی منعطف‌تر برای موبایل */
    max-width: 1100px;
    height: 80vh; /* ارتفاع viewport را به جای 90vh برای فضای بیشتر اسکرول در موبایل تنظیم کردیم */
    margin: 20px auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#chat-area {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
	align-items: center;
}

#chat-box {
    flex-grow: 1;
    padding: 25px;
    background-color: #f5f7fa;
    overflow-y: auto;
    scroll-behavior: smooth;
	height: 300px; /* ارتفاع ۱۰۰٪ از فضای باقیمانده */
    width: 95%;  /* عرض ۱۰۰٪ */
    overflow-y: auto; /* اسکرول عمودی */
}
  
/* پیام‌ها */
#message {
    max-width: 75%; /* کمی افزایش برای استفاده بهتر از فضا در دسکتاپ و حفظ ساختار */
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* پیام‌های کاربر (خودتان) */
#user-message {
    background: #3498db; 
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

/* پیام‌های دیگران */
#other-message {
    background: #ffffff;
    color: #333;
    margin-right: auto;
    border: 1px solid #e6e6e6;
    border-bottom-left-radius: 6px;
}

#other-message strong {
    font-size: 0.88em;
    color: #1E88E5;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
}


/* فرم ارسال پیام */
#message-form {
    padding: 15px 20px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%; /* عرض کامل برای فرم */
}

#message-form input[type="text"] {
    flex-grow: 1;
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 15pt;
}

#message-form button {
    background: #2ecc71; 
    color: #fff;
    border: none;
    padding: 14px 22px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    white-space: nowrap;
}

#message-form button:hover {
    background: #27ae60;
}


.message-box {
    background-color: #f0f0f0; 
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    max-width: 75%; /* تنظیم max-width مشابه پیام‌ها */
    position: relative;
}

/* نام کاربری (بالا سمت راست) */
.message-header-right {
    text-align: right; 
    margin-bottom: 5px;
    padding-bottom: 3px;
}

.username {
    font-weight: bold;
}

/* محتوای پیام (وسط) */
.message-content {
    padding-top: 5px;
    padding-bottom: 5px;
    word-wrap: break-word;
}

/* زمان (پایین سمت چپ) */
.message-footer-left {
    text-align: left; 
    font-size: 0.7em;
    color: #777;
    margin-top: 5px; 
}

.products-container {
    display: flex;
    flex-wrap: wrap;       
    justify-content: center;
    gap: 22px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.product-card {
    background: linear-gradient(145deg, #D0E6FF, #EAF7FF);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
    transition: all 0.5s ease;
    text-align: center;

    flex: 1 1 300px;  
    max-width: 360px; 
    overflow: hidden; 
}

.product-card img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 16px;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 18px 38px rgba(0,0,0,0.25);
}

input[type="submit"], input[type="reset"], input[type="button"] {
    background: linear-gradient(135deg, #1E88E5, #64B5F6);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 15pt;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s ease;
}

input[type="submit"]:hover {
    background: linear-gradient(135deg, #64B5F6, #1565C0);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}

input[type="reset"] {
    background: linear-gradient(135deg, #FF7043, #FF5722);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 15pt;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s ease;
}

input[type="reset"]:hover {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}

input[type="button"] {
    background: linear-gradient(135deg, #43A047, #66BB6A);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 15pt;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s ease;
}

input[type="button"]:hover {
    background: linear-gradient(135deg, #66BB6A, #2E7D32);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

input[type="submit"],
input[type="reset"],
input[type="button"] {
    width: 60%;
    max-width: 300px;
    text-align: center;
    margin: 8px 0;
}

input[type="text"], input[type="password"], input[type="email"], input[type="file"], textarea {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid #ccc;
    border-radius: 16px;
    margin-bottom: 18px;
    font-size: 14pt;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, textarea:focus {
    outline: none;
    border-color: #1E88E5;
    box-shadow: 0 0 14px rgba(30,136,229,0.4);
}

section.divTable {
    display: table;
    width: 100%;
    margin: 32px auto;
}

.divTableRow > .divTableCell {
    padding: 22px;
}

aside.divTableCell {
    background: linear-gradient(145deg, #EAF7FF, #D0E6FF);
    border-radius: 16px;
    padding: 22px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

aside.divTableCell:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.25);
}

footer {
    background: linear-gradient(90deg, #1E88E5, #1565C0);
    color: #fff;
    text-align: center;
    padding: 22px 0;
    margin-top: 32px;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 -8px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}
.about-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px 20px;
}

.about-wrapper {
    background: linear-gradient(145deg, #EAF7FF, #D0E6FF);
    padding: 40px;
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
    text-align: center;
    transition: all 0.4s ease;
}

.about-wrapper:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.about-wrapper h2 {
    font-size: 34px;
    margin-bottom: 20px;
}

.about-wrapper p {
    font-size: 18px;
    line-height: 2;
    color: #333;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, #1E88E5, #64B5F6);
    color: #fff;
    font-weight: 600;
    border-radius: 20px;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #64B5F6, #1565C0);
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}

/* مدیا کوئری‌های موبایل */
@media (max-width: 1024px) {
    .divTable, table {
        width: 95%;
    }
}

@media (max-width: 768px) {
    /* --- بخش‌های عمومی --- */
    nav .divTableRow, nav ul {
        flex-direction: column;
        align-items: center;
    }

    .divTableRow, tr {
        display: block;
    }

    .divTableCell, td {
        display: block;
        width: 100%;
        margin-bottom: 16px;
        text-align: right;
    }

    aside.divTableCell {
        width: 100%;
        margin-bottom: 24px;
    }

    .products-container {
        flex-direction: column;
        align-items: center;
    }

    .product-card {
        width: 90%;
        max-width: 360px;
    }
    
    .about-wrapper {
        padding: 25px;
    }

    .about-wrapper h2 {
        font-size: 28px;
    }

    .about-wrapper p {
        font-size: 16px;
    }
    
    /* --- تنظیمات چت برای موبایل --- */
    #chat-container {
        width: 100%; /* عرض کامل در موبایل */
        max-width: none;
        height: 90vh; /* ارتفاع کمی بیشتر برای اسکرول راحت‌تر */
        border-radius: 0; /* حذف حاشیه گرد در صورت پر کردن صفحه */
    }
    
    #chat-box {
        padding: 15px; /* پدینگ کمتر برای صرفه‌جویی در فضا */
    }
    
    /* تنظیم عرض پیام‌ها در موبایل */
    #message, .message-box {
        max-width: 85%; /* کمی بزرگتر از ۷۵٪ */
    }
    
    #user-message {
        margin-left: auto;
    }
    
    #other-message {
        margin-right: auto;
    }

    #message-form input[type="text"] {
        font-size: 13pt; /* فونت کمی کوچک‌تر در باکس ورودی */
    }

    #message-form button {
        padding: 12px 15px; /* دکمه ارسال کوچکتر */
    }
}

@media (max-width: 480px) {
    input[type="submit"], input[type="reset"], input[type="button"] {
        width: 100%;
    }
    .product-card {
        width: 95%;
    }
    
    /* تنظیمات بیشتر برای موبایل‌های بسیار کوچک */
    #message-form {
        padding: 10px;
        gap: 5px;
    }
    
    #message-form input[type="text"] {
        padding: 12px 15px;
    }
    
    #message-form button {
        padding: 12px 15px;
        font-size: 12pt;
    }
    
    #chat-box {
        padding: 10px;
    }
    /* جدید*/
/* --- فرم ارسال پیام (اصلاح شده برای textarea) --- */
#message-form {
    display: flex;
    align-items: flex-end; /* تراز کردن عمودی آیتم‌ها به پایین */
    gap: 10px; /* فاصله بین عناصر */
    padding: 15px 20px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    width: 100%;
}

#message-input {
    /* textarea با شناسه message-input باید فضای باقی‌مانده را بگیرد */
    flex-grow: 1; /* متن بیشترین فضای موجود را اشغال کند */
    width: auto; /* غیرفعال کردن عرض ثابت */
    min-height: 50px; /* ارتفاع اولیه دلخواه */
    resize: vertical; /* اجازه تغییر اندازه عمودی */
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 15pt;
    transition: all 0.3s ease;
}

#message-input:focus {
    outline: none;
    border-color: #1E88E5;
    box-shadow: 0 0 14px rgba(30,136,229,0.4);
}

#message-form button[type="submit"] {
    /* دکمه ارسال (به جای input[type="submit"]) */
    background: #2ecc71; 
    color: #fff;
    border: none;
    padding: 14px 22px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    white-space: nowrap;
    height: 50px; /* ارتفاع ثابت برای هم‌ترازی با textarea */
    flex-shrink: 0; /* دکمه نباید کوچک شود */
}

#message-form button[type="submit"]:hover {
    background: #27ae60;
}
.element-to-copy {
    user-select: text; /* یا auto */
    -webkit-user-select: text; /* برای مرورگرهای مبتنی بر WebKit مانند کروم/سافاری */
    -moz-user-select: text; /* برای فایرفاکس */
    -ms-user-select: text; /* برای اینترنت اکسپلورر/اج */
}

}
