
@font-face {
    font-family: 'Vazir';
    src: url('./fonts/Vazir.woff2') format('woff2'),
         url('./fonts/Vazir.woff') format('woff'),
         url('./fonts/Vazir.ttf') format('truetype');
    font-weight: normal;
    font-display: swap;
}
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #e0f2fe;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #d1fae5;
    --bg: #f0f9ff;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(14, 165, 233, 0.08);
    --shadow-hover: 0 10px 40px rgba(14, 165, 233, 0.15);
    
    --imp-low: #94a3b8;
    --imp-low-bg: #f1f5f9;
    --imp-normal: #0ea5e9;
    --imp-normal-bg: #e0f2fe;
    --imp-high: #f59e0b;
    --imp-high-bg: #fef3c7;
    --imp-critical: #ef4444;
    --imp-critical-bg: #fee2e2;
    
    --status-op: #10b981;
    --status-maint: #f59e0b;
    --status-deg: #f97316;
    --status-down: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.7;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ===========================
   آیکون‌های فقط CSS
   =========================== */
.icon-bell {
    display: inline-block;
    width: 22px;
    height: 22px;
    position: relative;
}
.icon-bell::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2.5px solid var(--primary);
    border-radius: 50% 50% 0 0;
    top: 2px;
    left: 3px;
    border-bottom: none;
    height: 13px;
}
.icon-bell::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2.5px;
    background: var(--primary);
    bottom: 4px;
    left: 1px;
    border-radius: 2px;
    box-shadow: 0 4px 0 -1px var(--primary);
}

.icon-calendar {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    position: relative;
    margin-top: 2px;
}
.icon-calendar::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 2px;
    right: 2px;
    height: 3px;
    border-left: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
}
.icon-calendar::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: currentColor;
}

.icon-lock-big {
    display: inline-block;
    width: 32px;
    height: 36px;
    position: relative;
}
.icon-lock-big::before {
    content: '';
    position: absolute;
    top: 0;
    left: 6px;
    width: 20px;
    height: 18px;
    border: 3px solid white;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}
.icon-lock-big::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 22px;
    background: white;
    border-radius: 4px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    position: relative;
    opacity: 0.5;
}
.empty-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--text-muted);
    border-radius: 50% 50% 0 0;
    border-bottom: none;
}
.empty-icon::after {
    content: '';
    position: absolute;
    top: 56%;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 3px;
}

/* ===========================
   هدر
   =========================== */
.header {
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
    color: white;
    padding: 60px 20px 80px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: drift 60s linear infinite;
    opacity: 0.5;
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(60px, 60px); }
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideDown 0.8s ease-out;
}

.header p {
    font-size: 1.15rem;
    opacity: 0.95;
    animation: slideDown 0.8s ease-out 0.1s backwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   نوار وضعیت
   =========================== */
.status-bar {
    max-width: 1100px;
    margin: -50px auto 30px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.status-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    animation: slideUp 0.8s ease-out 0.2s backwards;
    border: 1px solid var(--border);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.5;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

.status-dot.operational { background: var(--status-op); color: var(--status-op); }
.status-dot.maintenance { background: var(--status-maint); color: var(--status-maint); }
.status-dot.degraded { background: var(--status-deg); color: var(--status-deg); }
.status-dot.down { background: var(--status-down); color: var(--status-down); }

.status-text {
    font-weight: 600;
    font-size: 1rem;
}

.status-message {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-update {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===========================
   محتوای اصلی
   =========================== */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* فیلترها */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 25px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

/* ===========================
   کارت‌های اطلاعیه
   =========================== */
.announcements-grid {
    display: grid;
    gap: 18px;
}

.announcement {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--imp-normal);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out backwards;
    overflow: hidden;
}

.announcement::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 60%, rgba(14, 165, 233, 0.03) 100%);
    pointer-events: none;
    transition: opacity 0.3s;
}

.announcement:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.announcement.imp-low { border-right-color: var(--imp-low); }
.announcement.imp-normal { border-right-color: var(--imp-normal); }
.announcement.imp-high { border-right-color: var(--imp-high); }
.announcement.imp-critical { 
    border-right-color: var(--imp-critical);
    background: linear-gradient(to left, var(--imp-critical-bg) 0%, var(--bg-card) 8%);
    animation: fadeInUp 0.6s ease-out backwards, criticalPulse 3s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { box-shadow: var(--shadow); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1), var(--shadow-hover); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.announcement:nth-child(1) { animation-delay: 0.1s; }
.announcement:nth-child(2) { animation-delay: 0.2s; }
.announcement:nth-child(3) { animation-delay: 0.3s; }
.announcement:nth-child(4) { animation-delay: 0.4s; }
.announcement:nth-child(5) { animation-delay: 0.5s; }

.ann-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ann-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 200px;
}

.ann-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge.imp-low { background: var(--imp-low-bg); color: var(--imp-low); }
.badge.imp-normal { background: var(--imp-normal-bg); color: var(--imp-normal); }
.badge.imp-high { background: var(--imp-high-bg); color: var(--imp-high); }
.badge.imp-critical { 
    background: var(--imp-critical-bg); 
    color: var(--imp-critical);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge.pinned {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.ann-content {
    color: var(--text);
    line-height: 1.9;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ann-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ann-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ann-time-ago {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===========================
   حالت خالی
   =========================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text);
}

/* ===========================
   فوتر
   =========================== */
.footer {
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    border-top: 1px solid var(--border);
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.footer-logo-icon {
    width: 130px;
    height: 70px;

    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    overflow: hidden;
}

.footer-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===========================
   ادمین پنل
   =========================== */
.admin-container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.admin-header {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    padding: 10px 22px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--text-muted);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.form-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease-out;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.form-label .required {
    color: #ef4444;
}

.form-label .optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--bg-card);
    color: var(--text);
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.7;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.admin-list {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-item {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    transition: background 0.2s;
}

.admin-item:hover {
    background: var(--bg);
}

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

.admin-item-info {
    flex: 1;
    min-width: 250px;
}

.admin-item-title {
    font-weight: 700;
    margin-bottom: 5px;
}

.admin-item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-item-actions {
    display: flex;
    gap: 8px;
}

/* ===========================
   صفحه ورود
   =========================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(14, 165, 233, 0.15);
    animation: slideUp 0.6s ease-out;
}

.login-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
}

.login-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text);
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: slideUp 0.4s ease-out;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border-right: 4px solid #dc2626;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-right: 4px solid #10b981;
}

/* ===========================
   ریسپانسیو
   =========================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .header {
        padding: 40px 20px 70px;
    }
    
    .ann-title {
        font-size: 1.1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* اسکرول‌بار - تعریف شده پایین‌تر در بخش جدید */

::selection {
    background: var(--primary);
    color: white;
}

/* ========================================
   ✨ بخش بهبود UI و افکت‌های جدید
   ======================================== */

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    right: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), #8b5cf6);
    background-size: 200% 100%;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
    transition: width 0.1s linear;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

/* Aurora background در هدر */
.header {
    --aurora-x: 50%;
    --aurora-y: 50%;
}

.aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.7;
}

.aurora::before,
.aurora::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    mix-blend-mode: screen;
}

.aurora::before {
    background: radial-gradient(circle, #ffffff, transparent 70%);
    top: var(--aurora-y);
    left: var(--aurora-x);
    transform: translate(-50%, -50%);
    animation: auroraFloat1 20s ease-in-out infinite;
    transition: top 0.8s ease-out, left 0.8s ease-out;
}

.aurora::after {
    background: radial-gradient(circle, rgba(255, 200, 150, 0.6), transparent 70%);
    bottom: -20%;
    right: -10%;
    animation: auroraFloat2 25s ease-in-out infinite;
}

@keyframes auroraFloat1 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-40%, -60%) scale(1.2); }
}

@keyframes auroraFloat2 {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
}

/* Header h1 با gradient text effect */
.header h1 {
    background: linear-gradient(135deg, #ffffff 0%, #d1fae5 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: shineText 4s linear infinite, slideDown 0.8s ease-out;
}

@keyframes shineText {
    to { background-position: 200% center; }
}

/* فیلترها بار با سرچ */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filters-bar .filters {
    margin-bottom: 0;
}

.search-wrap {
    position: relative;
    flex: 0 1 280px;
    min-width: 200px;
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    pointer-events: none;
    transition: border-color 0.3s;
}

.search-icon::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: -6px;
    width: 7px;
    height: 2px;
    background: var(--text-muted);
    transform: rotate(45deg);
    border-radius: 1px;
    transition: background 0.3s;
}

.search-input {
    width: 100%;
    padding: 11px 40px 11px 16px;
    border: 2px solid var(--border);
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text);
    transition: all 0.3s;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.15);
    transform: translateY(-1px);
}

.search-wrap:focus-within .search-icon {
    border-color: var(--primary);
}
.search-wrap:focus-within .search-icon::after {
    background: var(--primary);
}

/* Reveal animations */
.announcement,
.status-card,
.section-title {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement.revealed,
.status-card.revealed,
.section-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* اطلاعیه با glassmorphism + glare */
.announcement {
    will-change: transform;
    transform-style: preserve-3d;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.85);
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.announcement::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: radial-gradient(
        circle 200px at var(--mouse-x) var(--mouse-y),
        rgba(14, 165, 233, 0.08),
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 1;
}

.announcement:hover::after {
    opacity: 1;
}

.announcement > * {
    position: relative;
    z-index: 2;
}

/* محتوای HTML داخل اطلاعیه */
.ann-content {
    direction: rtl;
}

.ann-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1.5px dashed var(--primary);
    padding-bottom: 1px;
    transition: all 0.2s;
    word-break: break-word;
}

.ann-content a:hover {
    color: var(--secondary-dark);
    border-bottom-color: var(--secondary-dark);
    border-bottom-style: solid;
}

.ann-content ul, .ann-content ol {
    padding-right: 25px;
    margin: 10px 0;
}

.ann-content li {
    margin-bottom: 5px;
}

.ann-content blockquote {
    border-right: 3px solid var(--primary);
    padding: 8px 15px;
    margin: 12px 0;
    background: var(--primary-light);
    border-radius: 8px;
    color: var(--text);
    font-style: italic;
}

.ann-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 15px 0;
}

.ann-content b, .ann-content strong {
    color: var(--text);
    font-weight: 700;
}

.ann-content u {
    text-decoration-color: var(--primary);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* ======================
   ✏️ ادیتور متن غنی
   ====================== */
.rich-editor {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    transition: all 0.3s;
}

.rich-editor:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    border-bottom: 1px solid var(--border);
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
}

.tb-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.tb-btn:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.tb-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.tb-btn svg {
    width: 16px;
    height: 16px;
}

.tb-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.tb-color-wrap {
    position: relative;
    display: inline-block;
}

.tb-color-btn {
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px !important;
    height: 34px !important;
}

.tb-color-letter {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.tb-color-bar {
    width: 18px;
    height: 4px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.1);
}

.tb-color-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* کلیک راست روی دکمه رنگ = باز شدن color picker */
.tb-color-wrap:hover .tb-color-input {
    pointer-events: auto;
}

.editor-area {
    min-height: 180px;
    padding: 18px;
    outline: none;
    line-height: 1.9;
    color: var(--text);
    direction: rtl;
    overflow-y: auto;
    max-height: 500px;
    font-size: 1rem;
}

.editor-area:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.editor-area a {
    color: var(--primary);
    text-decoration: underline;
}

.editor-area ul, .editor-area ol {
    padding-right: 25px;
}

.editor-area blockquote {
    border-right: 3px solid var(--primary);
    padding: 6px 12px;
    margin: 8px 0;
    background: var(--primary-light);
    border-radius: 6px;
}

.editor-area.shake {
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.editor-status {
    display: flex;
    justify-content: space-between;
    padding: 8px 18px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    gap: 12px;
}

/* مودال لینک */
.link-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.2s;
}

.link-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.link-modal-box {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.link-modal-box h3 {
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ======================
   🔘 افکت Ripple
   ====================== */
.btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* ======================
   🎉 Confetti
   ====================== */
.confetti {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
    animation: confettiBoom 0.9s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
    --dx: 0px;
    --dy: 0px;
    --rot: 0deg;
}

@keyframes confettiBoom {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.3);
    }
}

/* ======================
   ⬆️ دکمه برگشت به بالا
   ====================== */
.scroll-top {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 35px rgba(14, 165, 233, 0.5);
}

/* ======================
   🌈 حالت رنگین کمان (Easter Egg)
   ====================== */
.rainbow-mode {
    animation: rainbowBg 5s linear infinite;
}

.rainbow-mode .announcement {
    animation: rainbowBorder 3s linear infinite;
}

@keyframes rainbowBg {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes rainbowBorder {
    0%, 100% { border-right-color: #ef4444; }
    25% { border-right-color: #f59e0b; }
    50% { border-right-color: #10b981; }
    75% { border-right-color: #8b5cf6; }
}

/* ======================
   🎨 Status dot - بهبود
   ====================== */
.status-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(240,249,255,0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ======================
   📱 ریسپانسیو
   ====================== */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrap {
        flex: 1;
        max-width: 100%;
    }
    
    .editor-toolbar {
        gap: 2px;
        padding: 8px;
    }
    
    .tb-btn {
        min-width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .tb-divider {
        margin: 0 2px;
    }
    
    .scroll-top {
        bottom: 15px;
        left: 15px;
        width: 42px;
        height: 42px;
    }
}

/* بهبود دکمه‌های فیلتر با hover lift */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.filter-btn:not(.active):hover::before {
    opacity: 0.05;
}

/* بهبود badge های اهمیت */
.badge {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.badge:hover {
    transform: scale(1.1);
}

.badge.imp-critical::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to { left: 100%; }
}

/* announcement قبلی animation رو حذف کن چون تداخل داره */
.announcement.imp-critical {
    animation: criticalPulse 3s ease-in-out infinite !important;
}

/* اعداد فارسی در ann-content */
.ann-content {
    font-feature-settings: "ss01", "ss02";
}

/* اعداد در footer */
.footer-text {
    font-feature-settings: "ss01";
}

/* بهبود pin badge */
.badge.pinned {
    position: relative;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.4);
}

.badge.pinned::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: inherit;
}

.badge.pinned:hover::before {
    opacity: 1;
}

.badge.pinned > * {
    position: relative;
    z-index: 1;
}


/* ========================================
   ✨ موارد جدید: کپی لینک، رنگ سفارشی، اسکرول‌بار نازک
   ======================================== */

/* اسکرول‌بار نازک‌تر */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border-radius: 10px;
    opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--primary-dark), var(--secondary-dark));
    opacity: 1;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

/* ========================
   📋 آیکون کپی
   ======================== */
.copy-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    position: relative;
    flex-shrink: 0;
}

.copy-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 3px;
    width: 10px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    background: transparent;
}

.copy-icon::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    width: 10px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    background: var(--bg-card);
}

/* وقتی کپی شد - تیک */
.copied .copy-icon::before,
.copied .copy-icon::after {
    display: none;
}

.copied .copy-icon {
    width: 14px;
    height: 14px;
}

.copied .copy-icon::before {
    content: '';
    display: block;
    position: absolute;
    top: 6px;
    left: 1px;
    width: 5px;
    height: 2px;
    background: #10b981;
    transform: rotate(45deg);
    border: none;
    border-radius: 1px;
}

.copied .copy-icon::after {
    content: '';
    display: block;
    position: absolute;
    top: 4px;
    left: 4px;
    width: 9px;
    height: 2px;
    background: #10b981;
    transform: rotate(-45deg);
    border: none;
    border-radius: 1px;
}

/* ========================
   🔗 دکمه اشتراک‌گذاری اطلاعیه (سمت کاربر)
   ======================== */
.ann-actions {
    display: flex;
    gap: 8px;
}

.ann-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.ann-share-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(14, 165, 233, 0.2);
}

.ann-share-btn.copied {
    border-color: #10b981;
    color: #10b981;
    background: var(--secondary-light);
}

.ann-share-btn.copied span:last-child::after {
    content: ' شد!';
}

/* ========================
   🎯 highlight اطلاعیه target از URL
   ======================== */
.announcement.highlight-target {
    animation: highlightTarget 3s ease-out;
}

@keyframes highlightTarget {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5);
        transform: scale(1);
    }
    20% {
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0.3), 0 15px 50px rgba(14, 165, 233, 0.4);
        transform: scale(1.02);
    }
    100% {
        box-shadow: var(--shadow);
        transform: scale(1);
    }
}

.announcement.clicked-pulse {
    animation: clickedPulse 0.6s;
}

@keyframes clickedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.005); box-shadow: var(--shadow-hover); }
}

/* ========================
   🎨 پشتیبانی از رنگ سفارشی باکس
   ======================== */
.announcement.has-custom-color {
    border-right-color: var(--card-accent) !important;
    background: 
        linear-gradient(to left, color-mix(in srgb, var(--card-accent) 8%, transparent) 0%, var(--bg-card) 6%),
        var(--bg-card);
}

.announcement.has-custom-color::after {
    background: radial-gradient(
        circle 200px at var(--mouse-x) var(--mouse-y),
        color-mix(in srgb, var(--card-accent) 15%, transparent),
        transparent 50%
    );
}

/* fallback اگر color-mix پشتیبانی نشد */
@supports not (color: color-mix(in srgb, red, blue)) {
    .announcement.has-custom-color {
        background: var(--bg-card);
    }
}

/* ========================
   🎨 انتخابگر رنگ تو پنل ادمین
   ======================== */
.color-picker-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-preset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 8px;
    border: 2px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    background: var(--bg-card);
    transition: all 0.25s;
    font-size: 0.85rem;
    user-select: none;
}

.color-preset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.color-preset input[type="radio"] {
    display: none;
}

.color-preset-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: all 0.2s;
}

.color-preset:has(input:checked) {
    border-color: var(--c, var(--primary));
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.color-preset:has(input:checked) .color-preset-dot {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-color: var(--bg-card);
}

.color-preset:first-child .color-preset-dot {
    background: linear-gradient(135deg, transparent 45%, #ef4444 45%, #ef4444 55%, transparent 55%);
    border-color: var(--text-muted);
}

.color-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.color-custom-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.color-custom-input {
    width: 50px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
    background: var(--bg-card);
    transition: all 0.2s;
}

.color-custom-input:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

/* ========================
   🍞 Toast notification
   ======================== */
.toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--bg-card);
    color: var(--text);
    padding: 14px 22px;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    z-index: 10000;
    border: 2px solid var(--secondary);
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-error {
    border-color: #ef4444;
}

.toast-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(14, 165, 233, 0.3);
    flex-shrink: 0;
}

.toast.toast-error .toast-icon {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.toast.toast-error .toast-icon::after {
    content: '!';
}

.toast.toast-error .toast-icon span,
.toast-icon {
    font-size: 1rem;
}

.toast-text {
    font-weight: 600;
    font-size: 0.95rem;
}

@media (max-width: 600px) {
    .toast {
        right: 15px;
        left: 15px;
        bottom: 15px;
    }
}

/* ========================
   ⚡ status flash (وقتی وضعیت تغییر می‌کنه)
   ======================== */
.status-card.status-flash {
    animation: statusFlash 0.8s ease-out;
}

@keyframes statusFlash {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.2); }
    100% { box-shadow: var(--shadow); }
}

/* ========================
   📅 footer date redesign (در داخل ann-date)
   ======================== */
.ann-date {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ann-time-ago {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ========================
   ✨ افکت ورود تدریجی برای کارت تارگت
   ======================== */
.announcement.highlight-target::before {
    background: linear-gradient(135deg, transparent 50%, rgba(14, 165, 233, 0.08) 100%);
    opacity: 1;
}

/* ========================
   🎭 placeholder بهتر
   ======================== */
.editor-area:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.7;
    font-style: italic;
}

/* بهبود focus ring روی input ها */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid transparent;
}

/* ========================
   📱 ریسپانسیو موارد جدید
   ======================== */
@media (max-width: 600px) {
    .ann-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ann-actions {
        justify-content: flex-end;
    }
    
    .color-presets {
        gap: 6px;
    }
    
    .color-preset {
        padding: 5px 10px 5px 6px;
        font-size: 0.8rem;
    }
}

/* ========================
   🏷️ بهبود badge فوری - حذف انیمیشن قبلی + جدید
   ======================== */
.badge.imp-critical {
    position: relative;
    overflow: hidden;
}

/* lift روی همه badge ها هنگام hover کارت */
.announcement:hover .badge {
    transform: translateY(-1px);
}

