@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    scroll-behavior: smooth;
}
/* ============================================
   Persian Datepicker Custom Styles
   ============================================ */
.datepicker-plot-area {
    font-family: 'Vazirmatn', sans-serif !important;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    direction: rtl;
    z-index: 9999 !important;
}

    .datepicker-plot-area .datepicker-day-view .table-days td.selected span {
        background-color: #2563eb !important;
        color: #fff !important;
    }

    .datepicker-plot-area .datepicker-day-view .table-days td:hover span {
        background-color: #dbeafe !important;
        color: #1e40af !important;
    }

    .datepicker-plot-area .datepicker-header .btn.switch {
        background-color: #f3f4f6;
        border-radius: 0.375rem;
    }

.persian-date-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.25rem;
    padding-left: 2.5rem;
}

.dark .persian-date-input {
    background-color: #374151 !important;
    color: #e5e7eb;
    border-color: #4b5563;
}

.dark .datepicker-plot-area {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

    .dark .datepicker-plot-area .datepicker-day-view .table-days td span {
        color: #e5e7eb;
    }

    .dark .datepicker-plot-area .datepicker-day-view .table-days td:hover span {
        background-color: #2563eb !important;
    }

    .dark .datepicker-plot-area .datepicker-header .btn.switch {
        background-color: #374151;
        color: #e5e7eb;
    }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #818cf8;
    }

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

/* ============================================
   CKEditor 4 Content Images Styling
   ============================================ */
.prose img,
.article-content img,
#contentEditor + div img,
.cke_editable img {
    max-width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 0.75rem;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* برای ویرایشگر */
.cke_editable {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
    min-height: 400px;
    padding: 1rem 1.5rem;
    background: white;
}

.cke_chrome {
    border-radius: 0.75rem !important;
    overflow: hidden;
    border-color: #e5e7eb !important;
}

.cke_top {
    background: #f9fafb !important;
    border-color: #e5e7eb !important;
}

@media (max-width: 768px) {
    .prose img,
    .article-content img {
        max-height: 400px;
        border-radius: 0.5rem;
    }
}
/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Toast Animation */
.toast-item {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

    .toast-item.show {
        transform: translateX(0);
    }

/* Modal Animation */
.modal-enter {
    animation: fadeIn 0.2s ease;
}

.modal-leave {
    animation: fadeOut 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Prose Styles */
.prose {
    max-width: 65ch;
    color: #374151;
}

    .prose p {
        margin-bottom: 1.25em;
        line-height: 1.75;
    }

    .prose h2 {
        font-size: 1.5em;
        margin-top: 2em;
        margin-bottom: 1em;
        font-weight: 600;
    }

    .prose h3 {
        font-size: 1.25em;
        margin-top: 1.5em;
        margin-bottom: 0.75em;
        font-weight: 600;
    }

    .prose ul, .prose ol {
        margin-top: 1.25em;
        margin-bottom: 1.25em;
        padding-right: 1.5em;
    }

    .prose li {
        margin-top: 0.5em;
        margin-bottom: 0.5em;
    }

.dark .prose {
    color: #d1d5db;
}

/* Print Styles */
@media print {
    header, footer, .no-print {
        display: none !important;
    }

    body {
        background: white;
        padding: 0;
        margin: 0;
    }
}

/* RTL Fix for Swiper */
.swiper {
    direction: ltr;
}

.swiper-slide {
    direction: rtl;
}

/* Form Validation Styles */
.input-validation-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.field-validation-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

/* Tooltip */
.tooltip {
    position: relative;
}

    .tooltip:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background-color: #1f2937;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        z-index: 10;
    }
