:root {
    --primary: #0d4f8b;
    --primary-dark: #0a3d6e;
    --primary-light: #1a6bb5;
    --accent: #e8a838;
    --accent-hover: #d4952a;
    --success: #28a745;
    --danger: #dc3545;
    --dark: #1a2332;
    --gray: #6c757d;
    --light-bg: #f5f7fa;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

* {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark);
    line-height: 1.7;
}

/* Top Bar */
.top-bar {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

.top-bar a {
    transition: opacity 0.2s;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    padding: 0.6rem 0;
}

.navbar-brand {
    text-decoration: none;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.brand-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: white;
    line-height: 1.3;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-accent {
    background: var(--accent);
    color: white !important;
    border: none;
    font-weight: 600;
    padding: 0.45rem 1.2rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1565a8 50%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
}

/* Hero Slider (تصاویر قابل ویرایش) */
.hero-slider .hero-slide {
    position: relative;
    min-height: 420px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: white;
    display: flex;
    align-items: center;
}
.hero-slider .hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 45, 80, 0.82) 0%, rgba(13, 79, 139, 0.55) 55%, rgba(13, 79, 139, 0.35) 100%);
    z-index: 1;
}
.hero-slider .min-hero-content {
    min-height: 420px;
    padding: 3rem 0;
}
.hero-slider .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.hero-slider .hero-title,
.hero-slider .hero-subtitle {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.hero-slider .btn-light {
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: 10px;
}
.hero-slider .btn-outline-light {
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: 10px;
}
@media (max-width: 768px) {
    .hero-slider .hero-slide,
    .hero-slider .min-hero-content {
        min-height: 320px;
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(232, 168, 56, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero .btn-light {
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: 10px;
    font-size: 1rem;
}

.hero .btn-outline-light {
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: 10px;
    border-width: 2px;
}

/* Section */
.section-title {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--dark);
    margin-bottom: 0.3rem;
}

.section-subtitle {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.section-badge {
    display: inline-block;
    background: rgba(13, 79, 139, 0.1);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    margin-bottom: 0.8rem;
}

/* Cards */
.news-card, .event-card, .stat-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: none;
    overflow: hidden;
    height: 100%;
}

.news-card:hover, .event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.news-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.news-card .card-body {
    padding: 1.4rem;
}

.news-card .card-title {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .card-text {
    color: var(--gray);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--gray);
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.card-meta i {
    margin-left: 0.3rem;
}

/* Announcement */
.announcement-item {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.3rem;
    margin-bottom: 0.8rem;
    border-right: 4px solid var(--primary);
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
}

.announcement-item:hover {
    box-shadow: var(--card-shadow-hover);
}

.announcement-item.priority-2 {
    border-right-color: var(--danger);
    background: #fff5f5;
}

.announcement-item.priority-1 {
    border-right-color: var(--accent);
}

.announcement-item .title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.announcement-item .date {
    font-size: 0.78rem;
    color: var(--gray);
}

/* Event Card */
.event-date-badge {
    background: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    min-width: 70px;
}

.event-date-badge .day {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.event-date-badge .month {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Stats */
.stat-card {
    text-align: center;
    padding: 1.8rem 1rem;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
    color: white;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.75);
}

.footer-title {
    color: white;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-heading {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-text {
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.footer-contact li {
    margin-bottom: 0.6rem;
}

.footer-contact i {
    margin-left: 0.5rem;
    color: var(--accent);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.social-links a {
    display: inline-flex;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 0;
    transition: all 0.2s;
    text-decoration: none;
}

.social-links a:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* Forms */
.form-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 10px;
    padding: 0.65rem 1rem;
    border: 1.5px solid #e0e4e8;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 79, 139, 0.15);
}

.btn-primary {
    background: var(--primary);
    border: none;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    border-radius: 10px;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-weight: 800;
    font-size: 1.8rem;
}

/* Admin */
.admin-sidebar {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
}

.admin-sidebar .nav-link {
    color: var(--dark);
    border-radius: 10px;
    padding: 0.7rem 1rem !important;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(13, 79, 139, 0.1);
    color: var(--primary);
}

/* ─── Responsive / Mobile ─────────────────────────────────── */

html {
    -webkit-text-size-adjust: 100%;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* جلوگیری از اسکرول افقی ناخواسته */
body {
    overflow-x: hidden;
}

/* جداول در موبایل */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* دکمه‌ها در موبایل راحت‌تر لمس شوند */
@media (max-width: 991.98px) {
    .navbar .nav-link {
        padding: 0.65rem 0.75rem;
    }

    .navbar-collapse {
        background: var(--primary-dark);
        margin-top: 0.5rem;
        padding: 0.75rem 1rem 1rem;
        border-radius: 12px;
        max-height: 75vh;
        overflow-y: auto;
    }

    .navbar-nav .dropdown-menu {
        border: none;
        background: rgba(255, 255, 255, 0.08);
        padding: 0.25rem 0;
    }

    .navbar-nav .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.55rem 1rem;
    }

    .navbar-nav .dropdown-item:hover,
    .navbar-nav .dropdown-item:focus {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .navbar .btn-accent {
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.55rem;
        line-height: 1.35;
    }

    .hero-subtitle {
        font-size: 0.98rem;
        margin-bottom: 1.25rem;
    }

    .hero {
        padding: 2.5rem 0 3.5rem;
    }

    .brand-subtitle {
        display: none;
    }

    .brand-title {
        font-size: 0.95rem;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    /* دکمه‌های هیرو تمام‌عرض در موبایل کوچک */
    .hero .d-flex.gap-3,
    .hero-slider .d-flex.gap-3 {
        flex-direction: column;
        align-items: stretch;
    }

    .hero .btn,
    .hero-slider .btn {
        width: 100%;
        text-align: center;
    }

    /* کارت‌های آمار */
    .stat-card {
        padding: 1rem 0.75rem;
    }

    .stat-card .stat-number {
        font-size: 1.35rem;
    }

    .stat-card .stat-label {
        font-size: 0.8rem;
    }

    /* بخش‌ها */
    .section-title {
        font-size: 1.25rem;
    }

    .page-header {
        padding: 1.75rem 0;
    }

    .page-header h1 {
        font-size: 1.35rem;
    }

    /* کارت فرم و محتوا */
    .form-card {
        padding: 1.15rem;
        border-radius: 12px;
    }

    /* اخبار و رویدادها */
    .news-card .card-title {
        font-size: 0.98rem;
    }

    /* فوتر */
    .footer {
        text-align: center;
    }

    .footer .col-lg-3,
    .footer .col-lg-2,
    .footer .col-md-4 {
        margin-bottom: 1.5rem;
    }

    .footer-links,
    .footer-contact {
        display: inline-block;
        text-align: right;
    }

    .social-links {
        justify-content: center;
    }

    /* جداول ادمین */
    .table {
        font-size: 0.88rem;
    }

    .table .btn-sm {
        padding: 0.25rem 0.45rem;
        font-size: 0.78rem;
    }

    /* پنل ادمین */
    .admin-sidebar {
        margin-bottom: 1rem;
    }

    .admin-sidebar .nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .admin-sidebar .nav-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    /* فاصله اصلی صفحه */
    main {
        min-height: 50vh;
    }

    /* TinyMCE و ادیتورها */
    .tox-tinymce {
        max-width: 100% !important;
    }

    /* جلوگیری از بیرون‌زدگی کدها */
    code, pre {
        word-break: break-word;
        white-space: pre-wrap;
    }
}

@media (max-width: 576px) {
    .container,
    .container-sm {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .hero-slider .hero-slide,
    .hero-slider .min-hero-content {
        min-height: 280px;
    }

    .hero-slider .min-hero-content {
        padding: 2rem 0;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    /* فرم‌ها تمام‌عرض */
    .form-card .row > [class*="col-"] {
        margin-bottom: 0.25rem;
    }
}

/* Persian Datepicker */
.datepicker-plot-area {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    z-index: 2000 !important;
}
input.persian-date,
input.persian-datetime,
input.pdate,
input.pdatetime {
    direction: ltr;
    text-align: right;
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
}


/* Brand logo image (editable) */
.brand-icon .brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}
.brand-icon {
    overflow: hidden;
}


/* تصاویر داخل محتوای خبر/صفحه */
.news-content img,
.form-card .news-content img,
article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.75rem auto;
    border-radius: 8px;
}
