

:root {
    --primary-color: #3b82f6;
    --secondary-color: #2dd4bf;
    --accent-color: #2dd4bf;
    --accent-hover: #14b8a6;
    --text-color: #334155;
    --text-muted: #64748b;
    --light-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --darker-color: #0f172a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 0.75rem;
    margin-bottom: -0.75rem; 
    padding: 2rem;
    flex: 1 0 auto;
    box-sizing: border-box;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #000;
    color: #fff;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    background: #111111;
    color: #fff;
    transform: translateY(-1px);
}

.btn-block { display: block; width: 100%; box-sizing: border-box; margin: 0; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--secondary-color);
}

.text-center { text-align: center; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.social-link {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 1rem;
    background: #f8fafc;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease,
                transform 0.25s ease, box-shadow 0.25s ease;
}

.social-link:hover {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-color: transparent;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

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

.category-tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

a.category-tag:hover {
    background: var(--accent, #3b82f6);
    color: #fff;
    border-color: var(--accent, #3b82f6);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.dr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.dr-modal {
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 1.75rem;
    width: min(460px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
}

.dr-modal h4 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    -webkit-text-fill-color: #1e293b;
    background: none;
    border-bottom: none;
}

.dr-modal h4::after { display: none; }

.dr-info {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    margin-bottom: 18px;
    line-height: 1.6;
}

.dr-modal .form-group { margin-bottom: 12px; }

.dr-modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.dr-modal .form-control {
    width: 100%;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 13.5px;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dr-modal .form-control:focus {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.dr-modal textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.dr-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.dr-actions .btn {
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    color: #fff;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.dr-actions .btn:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    color: #fff;
}

.dr-actions .btn-secondary {
    background: #f8fafc;
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border-color, #e2e8f0);
}

.dr-actions .btn-secondary:hover {
    background: var(--border-color, #e2e8f0);
    filter: none;
    transform: none;
    color: #1e293b;
}

[dir="rtl"] .dr-actions { flex-direction: row-reverse; }

.is-hidden { display: none !important; }

.modal-feedback { margin-bottom: 0.75rem; font-size: 0.9rem; }

.feedback-ok    { color: var(--success-color); }
.feedback-error { color: var(--error-color); }
.feedback-info  { color: var(--text-muted); }

.question-modal-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.prose-content {
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.8;
    color: var(--text-color);
}

.prose-content h2, .prose-content h3, .prose-content h4 { margin-top: 2rem; }
.prose-content h4 { font-size: 1rem; }
.prose-content p, .prose-content ul, .prose-content ol { margin-bottom: 1rem; }
.prose-content ul, .prose-content ol { padding-left: 1.5rem; }

.unsubscribe-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 1rem;
}
.unsubscribe-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.unsubscribe-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}
.unsubscribe-icon--done { color: #22a06b; }
.unsubscribe-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}
.unsubscribe-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}
.unsubscribe-not-found {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    color: #c0392b;
    border-radius: 6px;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    text-align: left;
    word-break: break-all;
}
.unsubscribe-email-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.unsubscribe-email-input:focus { border-color: var(--primary-color); }
.unsubscribe-form { margin-bottom: 1rem; }
.unsubscribe-confirm-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}
.unsubscribe-confirm-btn:hover { background: #a93226; }
.unsubscribe-home-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #000;
    color: #fff;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.unsubscribe-home-btn:hover { background: #333; }
.unsubscribe-cancel-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-style: dotted;
}
.unsubscribe-cancel-link:hover { color: var(--text-color); }

@media (max-width: 1024px) {
    .container { padding: 1.5rem; }
}

@media (max-width: 992px) {
    .social-links { justify-content: center; }
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
}

@media (max-width: 480px) {
    .container { padding: 0.75rem; }
    .unsubscribe-card { padding: 2rem 1.25rem; }
}

[dir="rtl"] body {
    font-family: 'Cairo', 'Noto Naskh Arabic', Arial, sans-serif;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    letter-spacing: 0;
}

[dir="rtl"] .prose-content ul,
[dir="rtl"] .prose-content ol { padding-left: 0; padding-right: 1.5rem; }

@media (min-width: 1440px) {
    html { font-size: 18px; }
    .container { max-width: 1380px; }
}

@media (min-width: 1920px) {
    html { font-size: 20px; }
    .container { max-width: 1700px; }
}

@media (min-width: 2560px) {
    html { font-size: 22px; }
    .container { max-width: 2200px; }
}
