/* 
================================================
فایل CSS پلاگین ختم صلوات - نسخه سبک و زیبا
Khatm Salavat Plugin - Light & Beautiful Styles
assets/style.css
================================================
*/

/* ================================================
   متغیرهای CSS (CSS Variables)
================================================ */
:root {
    /* رنگ‌های اصلی */
    --primary-green: #16a085;
    --light-green: #1abc9c;
    --emerald: #2ecc71;
    --mint: #a8e6cf;
    --cream: #f8fff9;
    --gold: #f39c12;
    --soft-blue: #ebf8ff;
    --purple: #9b59b6;
    --orange: #e67e22;
    
    /* رنگ‌های متن */
    --text-primary: #2c3e50;
    --text-secondary: #34495e;
    --text-muted: #7f8c8d;
    --border-light: #ecf0f1;
    
    /* سایه‌ها */
    --shadow-colored: 0 8px 32px rgba(22, 160, 133, 0.15);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 40px rgba(22, 160, 133, 0.25);
    
    /* گرادیان‌ها */
    --gradient-green: linear-gradient(135deg, #16a085 0%, #1abc9c 50%, #2ecc71 100%);
    --gradient-gold: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* ردیوس‌ها */
    --radius: 20px;
    --radius-small: 12px;
}

/* ================================================
   استایل‌های عمومی و Reset
================================================ */
#khatm-salavat-container,
#khatm-summary-container,
#khatm-reports-container,
.khatm-admin-panel,
.khatm-admin-login {
    font-family: inherit;
    direction: rtl;
    box-sizing: border-box;
}

#khatm-salavat-container *,
#khatm-summary-container *,
#khatm-reports-container *,
.khatm-admin-panel *,
.khatm-admin-login * {
    box-sizing: border-box;
}

/* ================================================
   کانتینر اصلی پلاگین - فول عرض
================================================ */
#khatm-salavat-container {
    max-width: 100%;
    margin: 0;
    padding: 32px;
    background: #ffffff;
    min-height: auto;
    border-radius: 0;
}

/* ================================================
   هدر پلاگین
================================================ */
.khatm-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 48px 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-colored);
    position: relative;
    overflow: hidden;
}

.khatm-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-green);
}

.khatm-header h2 {
    margin: 0 0 24px 0;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* ================================================
   مجموع صلوات
================================================ */
.total-salavat {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--gradient-green);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 700;
    box-shadow: var(--shadow-colored);
    position: relative;
    overflow: hidden;
}

.total-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.25rem;
}

/* ================================================
   گرید کارت‌ها - حتماً سه ستونه
================================================ */
.khatm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

/* ================================================
   کارت‌های ختم
================================================ */
.khatm-card {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid rgba(22, 160, 133, 0.15);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.khatm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(22, 160, 133, 0.15);
}

.khatm-card.active {
    border-color: rgba(22, 160, 133, 0.3);
}

.khatm-card.completed {
    background: #f8f9fa;
    border-color: rgba(46, 204, 113, 0.3);
}

/* تصویر کارت */
.khatm-image {
    height: 220px;
    background: var(--gradient-green);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.khatm-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.khatm-card:hover .khatm-image img {
    transform: scale(1.05);
}

.no-image {
    font-size: 4rem;
    color: white;
}

/* محتوای کارت */
.khatm-content {
    padding: 32px 24px;
    position: relative;
    background: inherit;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ================================================
   عنوان‌های کارت (سه عنوان جداگانه)
================================================ */
.khatm-titles {
    margin-bottom: 20px;
    text-align: center;
}

.khatm-title-main {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-green);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.khatm-title-sub {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 4px 0;
    line-height: 1.3;
}

.khatm-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 24px 0;
    text-align: center;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ================================================
   نوار پیشرفت
================================================ */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
    margin: 24px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-green);
    border-radius: 6px;
    transition: width 0.8s ease;
    position: relative;
}

/* ================================================
   آمار کارت
================================================ */
.khatm-stats {
    text-align: center;
    margin: 24px 0;
}

.current-count {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.current-number {
    background: var(--gradient-green);
    color: white;
    padding: 14px 22px;
    border-radius: var(--radius-small);
    font-size: 1.375rem;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.target-number {
    background: #f8f9fa;
    color: var(--text-secondary);
    padding: 14px 22px;
    border-radius: var(--radius-small);
    font-size: 1.375rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(22, 160, 133, 0.1);
}

.remaining-count {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
    padding: 8px 16px;
    background: rgba(22, 160, 133, 0.1);
    border-radius: 20px;
    display: inline-block;
}

.completed-badge {
    background: var(--gradient-gold);
    color: white;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 1.125rem;
    font-weight: 800;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ================================================
   دکمه‌های صلوات
================================================ */
.buttons-guide {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(22, 160, 133, 0.1) 0%, rgba(26, 188, 156, 0.1) 100%);
    border-radius: var(--radius-small);
    border: 1px solid rgba(22, 160, 133, 0.2);
    backdrop-filter: blur(10px);
}

.buttons-guide-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0;
}

.salavat-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: nowrap;
}

.salavat-btn {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    padding: 16px 20px;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 800;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 70px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.salavat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-green);
    transition: left 0.4s ease;
    z-index: -1;
}

.salavat-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.salavat-btn:hover::before {
    left: 0;
}

.salavat-btn:hover::after {
    width: 100%;
    height: 100%;
}

.salavat-btn:hover {
    color: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.salavat-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.salavat-btn.clicked {
    transform: scale(0.95);
    animation: click-wave 0.6s ease;
}

/* ================================================
   مودال تایید
================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    animation: modal-fade-in 0.3s ease;
}

.modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    margin: 10% auto;
    padding: 48px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 480px;
    text-align: center;
    box-shadow: 
        var(--shadow-hover),
        0 0 100px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(22, 160, 133, 0.1);
    position: relative;
    overflow: hidden;
    animation: modal-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-green);
}

.modal-content h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 600;
}

#confirm-count {
    background: var(--gradient-green);
    color: white;
    font-weight: 900;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 1.375rem;
    box-shadow: var(--shadow-soft);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-confirm {
    background: var(--gradient-green);
    color: white;
    border: none;
    padding: 18px 36px;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 800;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.btn-confirm::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.4s ease;
}

.btn-confirm:hover::before {
    left: 100%;
}

.btn-confirm:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-cancel {
    background: rgba(127, 140, 141, 0.1);
    color: var(--text-secondary);
    border: 2px solid rgba(127, 140, 141, 0.3);
    padding: 16px 36px;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 800;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: rgba(127, 140, 141, 0.2);
    transform: translateY(-2px);
    border-color: rgba(127, 140, 141, 0.5);
}

/* ================================================
   بارگذاری (Loading)
================================================ */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    border: 6px solid rgba(22, 160, 133, 0.2);
    border-radius: 50%;
    border-top: 6px solid var(--primary-green);
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(22, 160, 133, 0.2);
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 700;
}

/* ================================================
   پیام‌های Toast
================================================ */
.success-toast {
    font-family: inherit;
    z-index: 1002;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-hover);
    border: 2px solid rgba(76, 175, 80, 0.2);
}

/* ================================================
   خلاصه آمار - فول عرض
================================================ */
#khatm-summary-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    direction: rtl;
}

#khatm-summary-container > div {
    background: #ffffff;
    border-radius: 0;
    padding: 32px;
    box-shadow: none;
    border: none;
    margin: 0;
    width: 100%;
}

#khatm-summary-container h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    margin-top: 1rem;
}

.summary-grid > div {
    text-align: center;
    padding: 20px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid;
    transition: none;
    position: relative;
    box-shadow: none;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-grid > div:hover {
    transform: none;
    box-shadow: none;
}

/* بوردر با رنگ متن */
.summary-grid > div:nth-child(1) { border-color: #16a085; }
.summary-grid > div:nth-child(2) { border-color: #f39c12; }
.summary-grid > div:nth-child(3) { border-color: #2ecc71; }
.summary-grid > div:nth-child(4) { border-color: #9b59b6; }

.summary-grid > div > div:first-child {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
    line-height: 1.1;
    word-break: break-all;
    overflow-wrap: break-word;
}

.summary-grid > div > div:last-child {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

/* رنگ‌های کارت‌های آمار */
.summary-grid > div:nth-child(1) > div:first-child { color: #16a085; }
.summary-grid > div:nth-child(2) > div:first-child { color: #f39c12; }
.summary-grid > div:nth-child(3) > div:first-child { color: #2ecc71; }
.summary-grid > div:nth-child(4) > div:first-child { color: #9b59b6; }

/* ================================================
   گزارشات کلی در یک باکس - فول عرض
================================================ */
#khatm-reports-container {
    max-width: 100%;
    margin: 0;
    padding: 32px;
    font-family: inherit;
    direction: rtl;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.khatm-reports-header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(22, 160, 133, 0.05) 0%, rgba(26, 188, 156, 0.05) 100%);
    border-radius: var(--radius);
    border: 2px solid rgba(22, 160, 133, 0.1);
}

.khatm-reports-header h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.khatm-reports-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 600;
    opacity: 0.8;
}

.khatm-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 1rem;
}

.khatm-report-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 24px;
}

.khatm-report-card h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.khatm-report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.khatm-report-item:last-child {
    border-bottom: none;
}

.khatm-report-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.khatm-report-value {
    font-weight: 800;
    color: var(--primary-green);
    font-size: 1.1rem;
}

.khatm-report-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

/* ================================================
   تایتل یکسان برای همه بخش‌ها
================================================ */
.khatm-section-header {
    text-align: center;
    margin: 4rem 0 0.1rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(22, 160, 133, 0.05) 0%, rgba(26, 188, 156, 0.05) 100%);
    border-radius: var(--radius);
    border: 2px solid rgba(22, 160, 133, 0.1);
    position: relative;
}

/* عنوان ختم‌های تمام شده - فاصله خیلی زیاد از بالا و کم به پایین */
.khatm-section-header.completed-section {
    margin: 8rem 0 0.1rem 0;
}

.khatm-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.khatm-section-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0;
    opacity: 0.8;
}

/* ================================================
   صفحه‌بندی
================================================ */
.khatm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 1rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(22, 160, 133, 0.1);
}

.khatm-pagination-btn {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-green);
    color: white;
    border: none;
    border-radius: var(--radius-small);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.khatm-pagination-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
    color: white;
    text-decoration: none;
}

.khatm-pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.khatm-pagination-number {
    padding: 0.75rem 1rem;
    background: rgba(22, 160, 133, 0.1);
    color: var(--primary-green);
    border: 2px solid rgba(22, 160, 133, 0.2);
    border-radius: var(--radius-small);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 45px;
    text-align: center;
}

.khatm-pagination-number:hover {
    background: rgba(22, 160, 133, 0.2);
    transform: translateY(-1px);
    color: var(--primary-green);
    text-decoration: none;
}

.khatm-pagination-number.active {
    background: var(--gradient-green);
    color: white;
    border-color: var(--primary-green);
    box-shadow: var(--shadow-colored);
}

.khatm-pagination-number.active:hover {
    color: white;
}

/* انیمیشن کلیک */
@keyframes click-wave {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* انیمیشن مودال */
@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-slide-in {
    from { transform: translateY(-50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* انیمیشن اسپینر */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* انیمیشن جشن */
@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(2deg); }
    50% { transform: scale(1.1) rotate(-2deg); }
    75% { transform: scale(1.05) rotate(1deg); }
}

.celebration {
    animation: celebrate 2s ease-in-out;
}

/* انیمیشن آتش‌بازی */
.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: firework 1s ease-out forwards;
}

@keyframes firework {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

/* ================================================
   Helper Classes (کلاس‌های کمکی)
================================================ */

.khatm-text-center { text-align: center; }
.khatm-text-right { text-align: right; }
.khatm-text-left { text-align: left; }

.khatm-font-bold { font-weight: bold; }
.khatm-font-normal { font-weight: normal; }

.khatm-mb-10 { margin-bottom: 10px; }
.khatm-mb-20 { margin-bottom: 20px; }
.khatm-mb-30 { margin-bottom: 30px; }

.khatm-mt-10 { margin-top: 10px; }
.khatm-mt-20 { margin-top: 20px; }
.khatm-mt-30 { margin-top: 30px; }

.khatm-p-10 { padding: 10px; }
.khatm-p-20 { padding: 20px; }
.khatm-p-30 { padding: 30px; }

.khatm-hidden { display: none; }
.khatm-visible { display: block; }

.khatm-flex { display: flex; }
.khatm-flex-column { flex-direction: column; }
.khatm-flex-wrap { flex-wrap: wrap; }
.khatm-justify-center { justify-content: center; }
.khatm-align-center { align-items: center; }

.khatm-w-full { width: 100%; }
.khatm-h-full { height: 100%; }

.khatm-border-radius { border-radius: var(--radius-small); }
.khatm-shadow { box-shadow: var(--shadow-soft); }

.khatm-no-margin { margin: 0; }
.khatm-rtl { direction: rtl; }
.khatm-ltr { direction: ltr; }

.khatm-text-muted { color: var(--text-muted); }

/* ================================================
   ریسپانسیو - تبلت
================================================ */
@media (max-width: 1024px) {
    .khatm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    #khatm-salavat-container,
    #khatm-summary-container,
    #khatm-reports-container {
        padding: 24px;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .khatm-reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   ریسپانسیو - موبایل
================================================ */
@media (max-width: 768px) {
    #khatm-salavat-container,
    #khatm-summary-container,
    #khatm-reports-container {
        padding: 20px;
        background: #ffffff;
    }
    
    .khatm-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .khatm-content {
        padding: 24px 20px;
    }
    
    .khatm-image {
        height: 200px;
    }
    
    .salavat-buttons {
        gap: 10px;
    }
    
    .salavat-btn {
        flex: 1;
        min-width: 50px;
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 15% auto;
        padding: 36px 28px;
        width: 95%;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 16px;
    }
    
    .buttons-guide {
        padding: 12px 16px;
    }
    
    .buttons-guide-text {
        font-size: 0.875rem;
    }
    
    /* خلاصه آمار در موبایل - طبق درخواست */
    .summary-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 16px !important;
    }
    
    /* کل صلوات - تک ستونه */
    .summary-grid > div:nth-child(1) { 
        grid-column: 1 / -1;
        grid-row: 1;
    }
    
    /* ختم های تمام شده - تک ستونه */
    .summary-grid > div:nth-child(2) { 
        grid-column: 1 / -1;
        grid-row: 2;
    }
    
    /* ختم فعال و صلوات امروز - دو ستونه در کنار هم */
    .summary-grid > div:nth-child(3) { 
        grid-column: 1;
        grid-row: 3;
    }
    
    .summary-grid > div:nth-child(4) { 
        grid-column: 2;
        grid-row: 3;
    }
    
    /* تایتل‌ها در موبایل */
    .khatm-section-header {
        margin: 1.5rem 0 1rem 0;
        padding: 1.25rem;
    }
    
    .khatm-section-header.completed-section {
        margin: 2.5rem 0 1rem 0;
    }
    
    .khatm-section-title {
        font-size: 1.375rem;
    }
    
    .khatm-section-subtitle {
        font-size: 0.9rem;
    }
    
    /* صفحه‌بندی در موبایل */
    .khatm-pagination {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1.25rem;
        margin: 1.5rem 0 0.5rem 0;
    }
    
    .khatm-pagination-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .khatm-pagination-number {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
        min-width: 40px;
    }
    
    /* گزارشات در موبایل */
    .khatm-reports-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .khatm-reports-header {
        padding: 24px 20px;
    }
    
    .khatm-reports-header h2 {
        font-size: 1.6rem;
    }
    
    .khatm-report-card {
        padding: 20px;
    }
}

/* ================================================
   ریسپانسیو - موبایل کوچک
================================================ */
@media (max-width: 480px) {
    .khatm-header h2 {
        font-size: 1.875rem;
    }
    
    .khatm-title-main {
        font-size: 1.125rem;
    }
    
    .khatm-title-sub {
        font-size: 0.9rem;
    }
    
    .khatm-image {
        height: 180px;
    }
    
    .khatm-content {
        padding: 20px 16px;
    }
    
    .current-number,
    .target-number {
        padding: 12px 18px;
        font-size: 1.125rem;
    }
    
    .salavat-btn {
        padding: 8px 10px;
        font-size: 0.9rem;
        min-width: 45px;
    }
    
    .modal-content {
        padding: 32px 20px;
    }
    
    /* آمار در موبایل کوچک - تغییر چیدمان */
    .summary-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    
    .summary-grid > div {
        padding: 16px 12px !important;
        min-height: 80px !important;
    }
    
    .summary-grid > div > div:first-child {
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }
    
    .summary-grid > div > div:last-child {
        font-size: 0.8rem !important;
    }
    
    /* کل صلوات و ختم های تمام شده - تک ستونه */
    .summary-grid > div:nth-child(1),
    .summary-grid > div:nth-child(2) {
        grid-column: 1 / -1 !important;
    }
    
    /* ختم فعال و صلوات امروز - دو ستونه در کنار هم */
    .summary-grid > div:nth-child(3) {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }
    
    .summary-grid > div:nth-child(4) {
        grid-column: 2 !important;
        grid-row: 3 !important;
    }
    
    /* تایتل‌ها در موبایل کوچک */
    .khatm-section-header {
        margin: 4rem 0 -1rem 0;
        padding: 1rem;
    }
    
    .khatm-section-header.completed-section {
        margin: 7rem 0 -1rem 0;
    }
    
    .khatm-section-title {
        font-size: 1.125rem;
    }
    
    .khatm-section-subtitle {
        font-size: 0.7rem;
    }
    
    /* گزارشات در موبایل کوچک */
    .khatm-reports-header {
        margin-bottom: 0.5rem;
        padding: 1rem;
    }
    
    .khatm-reports-header h2 {
        font-size: 1.125rem;
    }
    
    .khatm-reports-grid {
        margin-top: 0.5rem;
    }
    
    /* صفحه‌بندی در موبایل کوچک */
    .khatm-pagination {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        margin: 1rem 0 0.5rem 0;
    }
    
    .khatm-pagination-numbers {
        order: 1;
    }
    
    .khatm-pagination-btn {
        order: 2;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* ================================================
   تنظیمات چاپ
================================================ */
@media print {
    .salavat-buttons,
    .buttons-guide,
    .modal,
    .loading-overlay {
        display: none !important;
    }
    
    .khatm-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .summary-grid > div,
    .khatm-report-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ================================================
   تنظیمات دسترسی (Accessibility)
================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تباین بالا */
@media (prefers-contrast: high) {
    .khatm-card {
        border: 2px solid #000;
    }
    
    .salavat-btn {
        border: 2px solid #000;
    }
    
    .progress-fill {
        background: #000;
    }
}

/* ================================================
   استایل‌های پنل مدیریت فرانت‌اند
================================================ */

/* فرم ورود */
.khatm-admin-login {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    direction: rtl;
}

.khatm-admin-login-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.khatm-admin-login-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.khatm-admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* پنل مدیریت */
/* پنل مدیریت */
.khatm-admin-panel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    background: #f8f9fa;
    border-radius: 12px;
}

.khatm-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.khatm-admin-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-green);
    margin: 0;
}

.khatm-admin-logout-form {
    margin: 0;
}

/* بخش‌های مدیریت */
.khatm-admin-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.khatm-admin-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-green);
    padding-bottom: 10px;
}

/* فرم‌های مدیریت */
.khatm-admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.khatm-admin-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.khatm-admin-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.khatm-admin-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.khatm-admin-input,
.khatm-admin-select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #ffffff;
}

.khatm-admin-input:focus,
.khatm-admin-select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.1);
}

/* دکمه‌های مدیریت */
.khatm-admin-btn-primary {
    background: var(--gradient-green);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(22, 160, 133, 0.2);
}

.khatm-admin-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 160, 133, 0.3);
}

.khatm-admin-btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.khatm-admin-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.khatm-admin-btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.khatm-admin-btn-logout:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* پیام‌های وضعیت */
.khatm-admin-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.khatm-admin-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* جدول لیست ختم‌ها */
.khatm-admin-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.khatm-admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 0.9rem;
}

.khatm-admin-table th {
    background: var(--primary-green);
    color: white;
    padding: 15px 12px;
    text-align: center;
    font-weight: 700;
    border-bottom: 2px solid #16a085;
}

.khatm-admin-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.khatm-admin-table tr:hover {
    background: #f8f9fa;
}

/* سلول‌های جدول */
.khatm-admin-title-cell {
    max-width: 200px;
}

.khatm-admin-title-part {
    font-size: 0.85rem;
    margin: 2px 0;
    color: var(--text-secondary);
}

.khatm-admin-image-cell {
    text-align: center;
    width: 80px;
}

.khatm-admin-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.khatm-admin-no-image {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.khatm-admin-stats-cell {
    text-align: center;
    width: 120px;
}

.khatm-admin-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-green);
}

.khatm-admin-total {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.khatm-admin-status-cell {
    text-align: center;
    width: 100px;
}

/* نشان‌های وضعیت */
.khatm-admin-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.khatm-admin-badge-active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.khatm-admin-badge-hidden {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.khatm-admin-badge-completed {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.khatm-admin-badge-stats {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.khatm-admin-date-cell {
    text-align: center;
    width: 100px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* عملیات جدول */
.khatm-admin-actions-cell {
    width: 200px;
}

.khatm-admin-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.khatm-admin-action-form {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.khatm-admin-action-select {
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #ffffff;
}

.khatm-admin-btn-action {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.khatm-admin-btn-action:hover {
    background: #16a085;
}

.khatm-admin-action-buttons {
    display: flex;
    gap: 5px;
}

.khatm-admin-btn-warning {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    flex: 1;
}

.khatm-admin-btn-warning:hover {
    background: #e0a800;
}

.khatm-admin-btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    flex: 1;
}

.khatm-admin-btn-danger:hover {
    background: #c82333;
}

.khatm-admin-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .khatm-admin-panel {
        padding: 15px;
        margin: 10px;
    }
    
    .khatm-admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .khatm-admin-section {
        padding: 20px 15px;
    }
    
    .khatm-admin-form-row {
        grid-template-columns: 1fr;
    }
    
    .khatm-admin-table-wrapper {
        font-size: 0.8rem;
    }
    
    .khatm-admin-table th,
    .khatm-admin-table td {
        padding: 8px 6px;
    }
    
    .khatm-admin-actions {
        gap: 5px;
    }
    
    .khatm-admin-action-buttons {
        flex-direction: column;
    }
    
    .khatm-admin-login {
        margin: 20px auto;
        padding: 15px;
    }
    
    .khatm-admin-login-card {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .khatm-admin-table {
        font-size: 0.7rem;
    }
    
    .khatm-admin-image {
        width: 40px;
        height: 40px;
    }
    
    .khatm-admin-title-cell {
        max-width: 120px;
    }
    
    .khatm-admin-actions-cell {
        width: 150px;
    }
}
/* ================================================
   پایان فایل
================================================ */