﻿/* =========================================================
   Site Custom Styles — Modern RTL
   ========================================================= */

:root {
    --brand-primary: #1e40af;
    --brand-primary-dark: #1e3a8a;
    --brand-primary-light: #3b82f6;
    --brand-accent: #f59e0b;
    --brand-accent-dark: #d97706;
    --brand-success: #10b981;
    --brand-danger: #ef4444;
    --brand-info: #06b6d4;
    --text-primary: #1f2937;
    --text-muted: #6b7280;
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --border-soft: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: 'Yekan', Tahoma, Arial, sans-serif;
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main { flex: 1 0 auto; }

/* =========================================================
   Navbar
   ========================================================= */
.site-navbar {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    box-shadow: var(--shadow-md);
    padding: .7rem 0;
    z-index: 1030;
}

.site-navbar .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.site-navbar .navbar-brand i {
    font-size: 1.4rem;
    color: var(--brand-accent);
}

.site-navbar .nav-link {
    color: rgba(255,255,255,.85) !important;
    padding: .5rem .9rem !important;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
    color: #fff !important;
    background-color: rgba(255,255,255,.12);
}

.site-navbar .nav-cta {
    background-color: var(--brand-accent);
    color: #fff !important;
    font-weight: 600;
}

.site-navbar .nav-cta:hover {
    background-color: var(--brand-accent-dark);
    color: #fff !important;
}

.site-navbar .navbar-toggler {
    border-color: rgba(255,255,255,.3);
}

.site-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-navbar .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: .5rem;
}

.site-navbar .dropdown-item {
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    font-size: .92rem;
}

/* =========================================================
   Hero Section
   ========================================================= */
.hero-section {
    padding: 2.5rem 0 1.5rem;
}

.slideshow-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: .75rem;
    overflow: hidden;
}

.slideshow-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.mySlides {
    display: none;
    position: relative;
}

.mySlides img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
}

.mySlides .numbertext {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .85rem;
    z-index: 2;
}

.mySlides .text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
    color: #fff;
    padding: 2rem 1.2rem .9rem;
    font-size: 1rem;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0,0,0,.45);
    border-radius: 50%;
    font-size: 1.1rem;
    user-select: none;
    transition: background .2s;
    z-index: 3;
}

.prev:hover, .next:hover { background: rgba(0,0,0,.75); }
.prev { right: 12px; }
.next { left: 12px; }

.dots-wrapper {
    text-align: center;
    padding-top: .75rem;
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 4px;
    background-color: #cbd5e1;
    border-radius: 50%;
    display: inline-block;
    transition: background-color .25s;
}

.dot.active, .dot:hover { background-color: var(--brand-primary); }

/* Welcome Card */
.welcome-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem 1.5rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 4px solid var(--brand-accent);
}

.welcome-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    border-radius: 50%;
    font-size: 2rem;
    box-shadow: 0 6px 18px rgba(30,64,175,.35);
}

.welcome-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand-primary-dark);
    margin-bottom: .75rem;
}

.welcome-sub {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: 1.5rem;
}

.welcome-card .btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    border: none;
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(30,64,175,.25);
    transition: transform .15s;
}

.welcome-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(30,64,175,.4);
}

/* =========================================================
   Quick Links
   ========================================================= */
.quick-links-section {
    padding: 1rem 0 2.5rem;
}

.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.2rem .8rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all .22s ease;
    height: 100%;
    border: 1px solid var(--border-soft);
    min-height: 140px;
}

.quick-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    color: var(--brand-primary);
    border-color: var(--brand-primary-light);
}

.quick-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: .7rem;
}

.quick-card span {
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.5;
}

.bg-primary { background-color: var(--brand-primary) !important; }
.bg-success { background-color: var(--brand-success) !important; }
.bg-warning { background-color: var(--brand-accent) !important; }
.bg-info    { background-color: var(--brand-info) !important; }
.bg-danger  { background-color: var(--brand-danger) !important; }

/* =========================================================
   Banner
   ========================================================= */
.banner-section { padding-bottom: 2.5rem; }

.banner-card {
    background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-primary));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.banner-card i {
    font-size: 1.6rem;
    color: var(--brand-accent);
}

.banner-card p {
    margin: 0;
    font-size: 1rem;
}

/* =========================================================
   Section Header
   ========================================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--border-soft);
}

.section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary-dark);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.section-header h3 i { color: var(--brand-accent); }

.section-link {
    color: var(--brand-primary);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
}

.section-link:hover { color: var(--brand-accent-dark); }

/* =========================================================
   News
   ========================================================= */
.news-section { padding: 1rem 0 2.5rem; }

.news-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-soft);
    transition: all .22s;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-primary-light);
}

.news-date {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.news-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .6rem;
    color: var(--text-primary);
    text-align: justify;
    line-height: 1.6;
}

.news-excerpt {
    font-size: .88rem;
    color: var(--text-muted);
    flex: 1;
    text-align: justify;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-link {
    align-self: flex-start;
    margin-top: .9rem;
    color: var(--brand-primary);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.news-link:hover { color: var(--brand-accent-dark); }

/* =========================================================
   Comments
   ========================================================= */
.comments-section { padding: 1rem 0 3rem; }

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--brand-primary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
    padding-bottom: .6rem;
    border-bottom: 1px dashed var(--border-soft);
}

.comment-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--brand-primary-dark);
}

.comment-user i { font-size: 1.4rem; color: var(--brand-primary); }

.comment-date {
    font-size: .82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.comment-body {
    font-size: .93rem;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: justify;
}

.comment-replies {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-right: 3px solid var(--brand-accent);
}

.comment-replies h6 {
    font-size: .9rem;
    color: var(--brand-accent-dark);
    font-weight: 700;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.reply-item {
    font-size: .88rem;
    color: var(--text-primary);
    padding: .4rem 0;
    line-height: 1.7;
    text-align: justify;
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    border-radius: var(--radius-sm);
    padding: .55rem 1.25rem;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 1.25rem 0;
    margin-top: auto;
}

.footer-inner {
    text-align: center;
    font-size: .9rem;
}

.footer-inner i { color: var(--brand-accent); margin-left: .35rem; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 767.98px) {
    .hero-section { padding: 1.5rem 0 1rem; }
    .mySlides img { height: 220px; }
    .welcome-card { padding: 1.5rem 1rem; }
    .welcome-card h2 { font-size: 1.15rem; }
    .banner-card { flex-direction: column; text-align: center; }
    .section-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* =========================================================
   Form Messages — پیام‌های فرم (خطا، هشدار، موفقیت)
   ========================================================= */

/* ===== Container ===== */
.FormMessages {
    margin: 1rem 0;
}

    /* اگر خالی باشد، فضا اشغال نکند */
    .FormMessages:empty {
        display: none;
    }

    /* ===== Validation Summary ===== */
    .FormMessages .validation-summary-errors,
    .FormMessages > ul {
        list-style: none;
        padding: 0;
        margin: 0;
        background: linear-gradient(135deg, #fef2f2, #fee2e2);
        border: 1px solid #fecaca;
        border-right: 5px solid var(--brand-danger, #dc2626);
        border-radius: var(--radius-md, 12px);
        padding: 1rem 1.15rem;
        box-shadow: 0 2px 8px rgba(220, 38, 38, .08);
        position: relative;
        overflow: hidden;
    }

        /* آیکون هشدار گوشه */
        .FormMessages .validation-summary-errors::before,
        .FormMessages > ul::before {
            content: "\f071"; /* fa-exclamation-triangle */
            font-family: FontAwesome;
            position: absolute;
            top: 1rem;
            right: 1.15rem;
            color: var(--brand-danger, #dc2626);
            font-size: 1.15rem;
            opacity: .85;
        }

        /* ===== Items ===== */
        .FormMessages .validation-summary-errors li,
        .FormMessages > ul li {
            direction: rtl;
            text-align: right;
            list-style: none;
            color: #991b1b;
            font-size: .9rem;
            font-weight: 500;
            line-height: 1.8;
            padding: .3rem 0 .3rem 2rem; /* فضا برای آیکون */
            border-bottom: 1px dashed rgba(220, 38, 38, .15);
        }

            .FormMessages .validation-summary-errors li:last-child,
            .FormMessages > ul li:last-child {
                border-bottom: none;
                padding-bottom: 0;
            }

            .FormMessages .validation-summary-errors li:first-child,
            .FormMessages > ul li:first-child {
                padding-top: 0;
            }

/* ===== Validation field-level ===== */
.field-validation-error,
.text-danger {
    display: block;
    color: var(--brand-danger, #dc2626);
    font-size: .82rem;
    font-weight: 500;
    margin-top: .3rem;
    line-height: 1.6;
}

    .field-validation-error::before {
        content: "\f06a"; /* fa-exclamation-circle */
        font-family: FontAwesome;
        margin-left: .3rem;
        font-size: .82rem;
    }

/* ===== Validation valid (اختیاری) ===== */
.field-validation-valid {
    display: none;
}

/* ===== Validation Summary بدون خطا ===== */
.validation-summary-valid {
    display: none;
}

/* =========================================================
   Form Messages — پیام‌های فرم (نسخه اصلاح‌شده برای RTL)
   ========================================================= */

/* ===== Container ===== */
.FormMessages {
    margin: 1rem 0;
}

    .FormMessages:empty {
        display: none;
    }

    /* ===== Validation Summary ===== */
    .FormMessages .validation-summary-errors,
    .FormMessages > ul {
        list-style: none;
        padding: 1rem 3rem 1rem 1.15rem; /* ← padding-right بیشتر برای آیکون */
        margin: 0;
        background: linear-gradient(135deg, #fef2f2, #fee2e2);
        border: 1px solid #fecaca;
        border-right: 5px solid var(--brand-danger, #dc2626);
        border-radius: var(--radius-md, 12px);
        box-shadow: 0 2px 8px rgba(220, 38, 38, .08);
        position: relative;
        overflow: hidden;
    }

        /* آیکون گوشه راست */
        .FormMessages .validation-summary-errors::before,
        .FormMessages > ul::before {
            content: "\f071"; /* fa-exclamation-triangle */
            font-family: FontAwesome;
            position: absolute;
            top: 1rem;
            right: 1rem; /* ← فاصله از راست */
            color: var(--brand-danger, #dc2626);
            font-size: 1.15rem;
            opacity: .85;
            line-height: 1;
        }

        /* ===== Items ===== */
        .FormMessages .validation-summary-errors li,
        .FormMessages > ul li {
            direction: rtl;
            text-align: right;
            list-style: none;
            color: #991b1b;
            font-size: .9rem;
            font-weight: 500;
            line-height: 1.8;
            padding: .3rem 0; /* ← دیگر padding-left اضافی لازم نیست */
            border-bottom: 1px dashed rgba(220, 38, 38, .15);
        }

            .FormMessages .validation-summary-errors li:last-child,
            .FormMessages > ul li:last-child {
                border-bottom: none;
                padding-bottom: 0;
            }

            .FormMessages .validation-summary-errors li:first-child,
            .FormMessages > ul li:first-child {
                padding-top: 0;
            }

/* ===== Field-level errors ===== */
.field-validation-error,
.text-danger {
    display: block;
    color: var(--brand-danger, #dc2626);
    font-size: .82rem;
    font-weight: 500;
    margin-top: .3rem;
    line-height: 1.6;
}

    .field-validation-error::before {
        content: "\f06a"; /* fa-exclamation-circle */
        font-family: FontAwesome;
        margin-left: .3rem;
        font-size: .82rem;
    }

.field-validation-valid,
.validation-summary-valid {
    display: none;
}

/* =========================================================
   Variations — انواع پیام
   ========================================================= */

/* موفقیت */
.FormMessages.success ul,
.FormMessages .success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #bbf7d0;
    border-right-color: var(--brand-success, #10b981);
}

    .FormMessages.success ul::before,
    .FormMessages .success::before {
        content: "\f058"; /* fa-check-circle */
        color: var(--brand-success, #10b981);
    }

    .FormMessages.success ul li {
        color: #065f46;
        border-bottom-color: rgba(16, 185, 129, .15);
    }

/* اطلاع‌رسانی */
.FormMessages.info ul,
.FormMessages .info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
    border-right-color: var(--brand-primary, #1e40af);
}

    .FormMessages.info ul::before,
    .FormMessages .info::before {
        content: "\f05a"; /* fa-info-circle */
        color: var(--brand-primary, #1e40af);
    }

    .FormMessages.info ul li {
        color: #1e3a8a;
        border-bottom-color: rgba(30, 64, 175, .15);
    }

/* هشدار */
.FormMessages.warning ul,
.FormMessages .warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
    border-right-color: var(--brand-accent, #f59e0b);
}

    .FormMessages.warning ul::before,
    .FormMessages .warning::before {
        content: "\f071";
        color: var(--brand-accent, #f59e0b);
    }

    .FormMessages.warning ul li {
        color: #78350f;
        border-bottom-color: rgba(245, 158, 11, .15);
    }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 767.98px) {
    .FormMessages .validation-summary-errors,
    .FormMessages > ul {
        padding: .85rem 2.75rem .85rem 1rem; /* ← padding-right کمتر در موبایل */
    }

        .FormMessages .validation-summary-errors::before,
        .FormMessages > ul::before {
            top: .85rem;
            right: .85rem;
            font-size: 1rem;
        }

        .FormMessages .validation-summary-errors li,
        .FormMessages > ul li {
            font-size: .85rem;
        }

    .field-validation-error,
    .text-danger {
        font-size: .78rem;
    }
}