/* ============================================
   DONATION PLATFORM — PREMIUM CSS
   Mobile-First | iOS-style | RTL | Dark Mode
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e5e5ea;
    --text-primary: #1c1c1e;
    --text-secondary: #636366;
    --text-tertiary: #aeaeb2;
    --accent: #007aff;
    --accent-hover: #0056cc;
    --accent-light: rgba(0, 122, 255, 0.1);
    --success: #34c759;
    --success-light: rgba(52, 199, 89, 0.12);
    --danger: #ff3b30;
    --danger-hover: #d62d23;
    --danger-light: rgba(255, 59, 48, 0.1);
    --warning: #ff9500;
    --border: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --radius-full: 9999px;
    --progress-bg: #e5e5ea;
    --progress-fill: linear-gradient(90deg, #34c759, #30d158);
    --donate-bg: linear-gradient(135deg, #0070ba 0%, #003087 100%);
    --donate-hover: linear-gradient(135deg, #005ea6 0%, #002570 100%);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.9375rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 1.875rem;
    --font-size-3xl: 2.25rem;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --text-tertiary: #636366;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-light: rgba(10, 132, 255, 0.15);
    --success: #30d158;
    --success-light: rgba(48, 209, 88, 0.15);
    --danger: #ff453a;
    --danger-hover: #ff6961;
    --danger-light: rgba(255, 69, 58, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.2);
    --progress-bg: #3a3a3c;
}

/* --- Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-en);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

[dir="rtl"] body,
body[data-lang="ar"] {
    font-family: var(--font-ar);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    margin-bottom: var(--space-md);
    transition: background var(--transition), box-shadow var(--transition);
    animation: fadeIn 0.4s ease-out;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--font-size-base);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-icon {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-xs);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
}

.btn-xs {
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    border-radius: 6px;
}

.btn-full {
    width: 100%;
}

.btn-donate {
    background: var(--donate-bg);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 112, 186, 0.35);
}

.btn-donate:hover {
    background: var(--donate-hover);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 112, 186, 0.45);
    transform: translateY(-1px);
}

.btn-donate:active {
    transform: translateY(0);
}

.btn-donate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

[data-theme="dark"] .site-header {
    background: rgba(28, 28, 30, 0.72);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.header-brand {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: block;
}

/* ==========================================
   HOMEPAGE — Campaign Grid
   ========================================== */
.homepage {
    padding: var(--space-xl) 0 var(--space-2xl);
}

.home-hero {
    text-align: center;
    padding: var(--space-2xl) 0;
    margin-bottom: var(--space-lg);
}

.home-hero h1 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--accent), #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero p {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    max-width: 500px;
    margin: 0 auto;
}

.campaigns-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.campaign-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
    animation: fadeIn 0.5s ease-out both;
}

.campaign-card:nth-child(2) {
    animation-delay: 0.1s;
}

.campaign-card:nth-child(3) {
    animation-delay: 0.15s;
}

.campaign-card:nth-child(4) {
    animation-delay: 0.2s;
}

.campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.card-cover {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.campaign-card:hover .card-cover img {
    transform: scale(1.03);
}

.card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.card-logo {
    position: absolute;
    bottom: -16px;
    left: var(--space-md);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    padding: 3px;
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .card-logo {
    left: auto;
    right: var(--space-md);
}

.card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-xs) - 3px);
}

.card-body {
    padding: var(--space-lg) var(--space-md) var(--space-md);
}

.card-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.3;
}

.card-owner {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.card-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-progress {
    margin-top: auto;
}

.card-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--progress-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.card-progress-fill {
    height: 100%;
    background: var(--progress-fill);
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.card-raised {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--success);
}

.card-goal {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.card-meta {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.empty-state-page {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-tertiary);
}

.empty-state-page svg {
    margin: 0 auto var(--space-lg);
    opacity: 0.3;
}

.empty-state-page h2 {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* ==========================================
   CAMPAIGN PAGE
   ========================================== */
.campaign-layout {
    padding: var(--space-md) 0 var(--space-2xl);
}

.campaign-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.cover-section {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--space-md);
    background: var(--bg-tertiary);
}

.cover-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.cover-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.logo-badge {
    position: absolute;
    bottom: -24px;
    left: var(--space-lg);
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    padding: 4px;
    box-shadow: var(--shadow-md);
    z-index: 2;
}

[dir="rtl"] .logo-badge {
    left: auto;
    right: var(--space-lg);
}

.logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-sm) - 4px);
}

.campaign-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.campaign-owner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}

.campaign-owner svg {
    flex-shrink: 0;
}

.campaign-short-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.campaign-full-desc {
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.campaign-full-desc.collapsed {
    max-height: 0;
}

.campaign-full-desc.expanded {
    max-height: 2000px;
}

.desc-content {
    color: var(--text-secondary);
    line-height: 1.8;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    padding: var(--space-sm) 0;
}

.read-more-btn svg {
    transition: transform var(--transition);
}

.read-more-btn.expanded svg {
    transform: rotate(180deg);
}

/* Progress */
.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-md);
}

.progress-raised .amount {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--success);
    line-height: 1.2;
}

.progress-raised .label,
.progress-goal .label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-goal .amount {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--progress-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-bar {
    height: 100%;
    background: var(--progress-fill);
    border-radius: var(--radius-full);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.meta-item svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Donate */
.donate-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.preset-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.preset-btn {
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.preset-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.preset-custom {
    grid-column: span 3;
    font-size: var(--font-size-sm);
}

.custom-amount-input {
    margin-bottom: var(--space-md);
}

.custom-amount-input input {
    width: 100%;
    padding: 12px var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: var(--font-size-md);
    font-weight: 600;
    text-align: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--transition);
    outline: none;
}

.custom-amount-input input:focus {
    border-color: var(--accent);
}

.paypal-note {
    margin-top: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.5;
}

/* Donations List */
.section-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.donation-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.3s ease-out both;
}

.donation-item:last-child {
    border-bottom: none;
}

.donation-item:nth-child(1) {
    animation-delay: 0.05s;
}

.donation-item:nth-child(2) {
    animation-delay: 0.1s;
}

.donation-item:nth-child(3) {
    animation-delay: 0.15s;
}

.donation-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.donation-info {
    flex: 1;
    min-width: 0;
}

.donation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 2px;
}

.donation-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.donation-amount {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--success);
    white-space: nowrap;
}

.donation-message {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 4px 0;
    line-height: 1.4;
}

.donation-date {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.empty-msg {
    color: var(--text-tertiary);
    text-align: center;
    padding: var(--space-xl) 0;
    font-size: var(--font-size-sm);
}

/* Updates */
.update-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.update-item:last-child {
    border-bottom: none;
}

.update-date-badge {
    min-width: 48px;
    height: 48px;
    border-radius: var(--radius-xs);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-align: center;
    flex-shrink: 0;
}

.update-body h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 4px;
}

.update-body p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.show-all-btn {
    display: inline-flex;
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    padding: var(--space-sm) 0;
    margin-top: var(--space-sm);
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: start;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--transition);
}

.faq-question:hover {
    color: var(--accent);
}

.faq-chevron {
    flex-shrink: 0;
    transition: transform var(--transition);
    color: var(--text-tertiary);
}

.faq-item.active .faq-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: var(--space-md);
}

.faq-answer p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Share */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.share-copy {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-copy:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.share-whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.share-whatsapp:hover {
    background: rgba(37, 211, 102, 0.2);
    color: #25d366;
}

.share-facebook {
    background: rgba(24, 119, 242, 0.1);
    color: #1877f2;
}

.share-facebook:hover {
    background: rgba(24, 119, 242, 0.2);
    color: #1877f2;
}

.share-x {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-x:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    border-top: 1px solid var(--border);
}

/* Inactive */
.inactive-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-lg);
}

.inactive-card {
    text-align: center;
    max-width: 400px;
}

.inactive-icon {
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.inactive-card h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

.inactive-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Toast */
#toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-md);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

[dir="rtl"] #toast-container {
    right: auto;
    left: var(--space-md);
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    max-width: 340px;
    line-height: 1.4;
}

[dir="rtl"] .toast {
    transform: translateX(-120%);
}

.toast.toast-success {
    background: var(--success);
}

.toast.toast-error {
    background: var(--danger);
}

.toast.toast-info {
    background: var(--accent);
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    to {
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Mobile / Desktop */
.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }

    .campaign-grid {
        grid-template-columns: 1fr 380px;
        gap: var(--space-xl);
        align-items: start;
    }

    .sidebar-sticky {
        position: sticky;
        top: 72px;
    }

    .campaign-title {
        font-size: var(--font-size-2xl);
    }

    .cover-image {
        aspect-ratio: 2/1;
    }

    .campaigns-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-hero h1 {
        font-size: var(--font-size-3xl);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-xl);
    }

    .campaign-title {
        font-size: var(--font-size-3xl);
    }

    .campaigns-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================
   LOGIN
   ========================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    padding: var(--space-lg);
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: var(--space-xl) var(--space-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
}

.login-icon {
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.login-card h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-lg);
}

.login-footer {
    text-align: center;
    margin-top: var(--space-lg);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.back-link:hover {
    color: var(--accent);
}

/* --- Forms --- */
.form-group {
    margin-bottom: var(--space-md);
    text-align: start;
}

.form-group label,
.form-group-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px var(--space-md);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636366' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

[dir="rtl"] .form-group select {
    background-position: left 12px center;
    padding-right: var(--space-md);
    padding-left: 36px;
}

.alert {
    padding: 12px var(--space-md);
    border-radius: var(--radius-xs);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--space-md);
    line-height: 1.4;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

/* ==========================================
   ADMIN
   ========================================== */
.admin-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.admin-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.admin-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.admin-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 4px;
    border: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: none;
    border-radius: calc(var(--radius-sm) - 2px);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: var(--space-lg);
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Actions Bar */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

/* Form sections */
.form-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: var(--space-lg);
    border: 1px solid var(--border);
    margin-bottom: var(--space-md);
}

.form-section h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.form-row {
    margin-bottom: var(--space-md);
}

.form-actions {
    margin-top: var(--space-lg);
}

/* Toggle */
.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 48px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    position: relative;
    transition: background var(--transition);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition);
}

.toggle-label input:checked+.toggle-switch {
    background: var(--success);
}

.toggle-label input:checked+.toggle-switch::after {
    transform: translateX(20px);
}

[dir="rtl"] .toggle-switch::after {
    left: auto;
    right: 3px;
}

[dir="rtl"] .toggle-label input:checked+.toggle-switch::after {
    transform: translateX(-20px);
}

/* Admin list items */
.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.admin-list-item:hover {
    background: var(--accent-light);
}

.admin-list-item:last-child {
    border-bottom: none;
}

.list-item-info {
    flex: 1;
    min-width: 0;
}

.list-item-info strong {
    font-size: var(--font-size-sm);
    display: block;
    margin-bottom: 2px;
}

.list-item-actions {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    flex-shrink: 0;
}

.item-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin: 4px 0;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

.text-muted {
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
}

code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: var(--font-size-xs);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.badge-active {
    background: var(--success-light);
    color: var(--success);
}

.badge-inactive {
    background: var(--danger-light);
    color: var(--danger);
}

.badge {
    background: var(--success-light);
    color: var(--success);
}

.empty-state {
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--space-xl);
    font-size: var(--font-size-sm);
}

/* Row progress bar */
.row-progress {
    margin-top: var(--space-sm);
}

.row-progress-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: var(--progress-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.row-progress-fill {
    height: 100%;
    background: var(--progress-fill);
    border-radius: var(--radius-full);
}

/* Image preview */
.image-preview {
    margin-bottom: var(--space-md);
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-width: 400px;
}

.image-preview img {
    width: 100%;
    height: auto;
}

.image-preview-sm {
    max-width: 100px;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn:focus-visible,
.faq-question:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media print {

    .site-header,
    .share-section,
    .donate-card,
    .site-footer {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    body {
        background: #fff;
        color: #000;
    }
}