/* فونت Ray */
@font-face {
    font-family: 'Ray';
    src: url('Ray.ttf') format('truetype');
}

@media (max-width: 768px) {
    .content-wrapper {
        display: flex;
        flex-direction: column; /* همه ستون‌ها زیر هم */
        align-items: center;    /* وسط چین کردن همه */
        gap: 20px;
    }

    /* sidebar-left و sidebar-right به صورت normal نمایش داده می‌شوند اما جایگاه تغییر می‌کند */
    .sidebar-left,
    .sidebar-right,
    .main-content {
        width: 95%; /* تقریبا تمام عرض */
        margin: 0 auto;
    }

    /* ترتیب نمایش روی موبایل */
    .content-wrapper {
        display: flex;
        flex-direction: column;
    }

    /* باکس بخش‌ها بالای مقاله */
    .sidebar-right {
        order: 0; /* بالای همه */
    }

    /* مقاله وسط */
    .main-content {
        order: 1; /* وسط */
    }

    /* مقالات دیگر پایین مقاله */
    .sidebar-left {
        order: 2; /* پایین */
    }

    /* عنوان‌ها و کارت‌ها وسط چین */
    .article-title, 
    .sidebar-right h3,
    .sidebar-left h3 {
        text-align: center;
    }

    /* بخش‌های مقاله و مقالات دیگر */
    .article-body .section-card,
    .sidebar-left ul li,
    .sidebar-right ul li {
        width: 100%;
        text-align: center;
    }
}





/* -------------------- */
/* پایه سایت */
body {
    font-family: 'Ray', Tahoma, sans-serif;
    background: #f4f6f8;
    color: #333;
    line-height: 1.6;
    margin: 0;
    direction: rtl;
}

/* -------------------- */
/* هدر سایت */
.header {
    width: 100%;
    background: linear-gradient(135deg,#41a664,#66c286);
    color: #fff;
    padding: 20px 0;
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* -------------------- */
/* صفحه اصلی (index.php) */
.content-wrapper {
    display: flex;
    justify-content: space-between; /* این روی موبایل مشکل داره */
    width: 95%;
    max-width: 1400px;
    margin: 30px auto;
    gap: 20px;
}


/* ستون چپ: لیست مقالات */
.sidebar-left {
    width: 20%;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.sidebar-left h3 {
    margin-bottom: 15px;
    color: #41a664;
}

.sidebar-left ul {
    list-style: none;
    padding: 0;
}

.sidebar-left li {
    margin-bottom: 10px;
}

.sidebar-left a {
    text-decoration: none;
    color: #339155;
    font-weight: 500;
    transition: 0.3s;
}

.sidebar-left a:hover {
    color: #41a664;
}

/* ستون وسط: مقاله و بخش‌ها */
.main-content {
    width: 55%;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.article-title {
    font-size: 32px;
    margin-bottom: 20px;
    color: #41a664;
    text-align: center;
}

.article-body .section-card {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.05);
}

.article-body .section-card h3 {
    margin-top: 0;
    font-size: 20px;
    color: #339155;
}

.article-body .section-card p {
    font-size: 16px;
    line-height: 1.5;
}

/* ستون راست: فهرست بخش‌ها */
.sidebar-right {
    width: 20%;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.sidebar-right h3 {
    margin-bottom: 15px;
    color: #41a664;
}

.sidebar-right ul {
    list-style: none;
    padding: 0;
}

.sidebar-right li {
    margin-bottom: 10px;
}

.sidebar-right a {
    text-decoration: none;
    color: #339155;
    font-weight: 500;
    transition: 0.3s;
}

.sidebar-right a:hover {
    color: #41a664;
}

.sidebar-right li.active a {
    font-weight: bold;
    color: #ff6347;
}

/* -------------------- */
/* پنل ادمین */
.admin-container {
    display: flex;
    flex-direction: column;
    width: 95%;
    max-width: 1300px;
    margin: 20px auto;
}

/* دکمه خروج */
.logout-btn {
    display: inline-block;
    background: #ff4b5c;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    margin: 15px 0;
    transition: 0.3s;
}

.logout-btn:hover {
    background: #e03e50;
}

/* Wrapper کارت‌ها */
.cards-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

/* کارت‌ها */
.card {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    flex: 1 1 45%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

.card h2 {
    margin-top: 0;
    color: #41a664;
    font-size: 22px;
}

/* فرم‌ها یکدست */
.card form {
    display: flex;
    flex-direction: column;
}

.card label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #339155;
}

.card input[type="text"],
.card input[type="number"],
.card textarea,
.card select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-family: 'Ray', Tahoma, sans-serif;
    font-size: 15px;
    box-sizing: border-box;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.card button {
    background: #41a664;
    color: #fff;
    font-weight: bold;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.card button:hover {
    background: #339155;
}

/* لیست مقالات */
.section-card {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    border-left: 5px solid #41a664;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.section-card:hover {
    background: #eef8f2;
}

.section-card a {
    margin-left: 10px;
    color: #41a664;
    font-weight: 500;
    transition: 0.3s;
}

.section-card a:hover {
    color: #339155;
}

/* -------------------- */
/* نوتیفیکیشن (Toast) */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #41a664;
    color: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, top 0.5s;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    top: 40px;
    pointer-events: auto;
}
