/* DevGive Clone - Pure PHP version */

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.hero-gradient {
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(14, 165, 233, 0.10), transparent 60%),
        radial-gradient(800px 400px at 0% 100%, rgba(37, 99, 235, 0.10), transparent 60%);
}

.grid-card { position: relative; }
.grid-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
    pointer-events: none;
    border-radius: inherit;
}

.card-glow { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -10px rgba(14, 165, 233, 0.25);
}

.stat-tile {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(37, 99, 235, 0.04));
    border: 1px solid rgb(226, 232, 240);
}

.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(37, 99, 235, 0.10));
    color: #0ea5e9;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.10), rgba(37, 99, 235, 0.10));
    color: #0ea5e9;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(14, 165, 233, 0.20);
}
.pill span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0ea5e9;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.cta-primary {
    background: linear-gradient(90deg, #0ea5e9, #2563eb);
    box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.5);
    transition: all 0.2s ease;
}
.cta-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.6);
}

.cta-outline {
    border: 1px solid rgb(203, 213, 225);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}
.cta-outline:hover {
    border-color: rgba(14, 165, 233, 0.4);
    background: rgba(255, 255, 255, 0.85);
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.alert {
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid;
}
.alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-error   { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.alert-info    { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    color: rgb(71, 85, 105);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}
.admin-sidebar-link:hover {
    background: rgb(241, 245, 249);
    color: #0f172a;
}
.admin-sidebar-link.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.12), rgba(37, 99, 235, 0.10));
    color: #0ea5e9;
    font-weight: 600;
}

/* ============================================================
   Dark Mode (triggered by html.dark class)
   ============================================================ */
html.dark body { background: #0f172a; color: #e2e8f0; }
html.dark .bg-white { background-color: #1e293b !important; }
html.dark .bg-slate-50 { background-color: #0f172a !important; }
html.dark .bg-slate-100 { background-color: #1e293b !important; }
html.dark .text-slate-800,
html.dark .text-slate-900 { color: #e2e8f0 !important; }
html.dark .text-slate-700 { color: #cbd5e1 !important; }
html.dark .text-slate-600 { color: #94a3b8 !important; }
html.dark .border-slate-200 { border-color: #334155 !important; }
html.dark .border-slate-100 { border-color: #334155 !important; }
html.dark .bg-slate-200 { background-color: #475569 !important; }
html.dark .divide-slate-100 > * { border-color: #334155 !important; }
html.dark .hover\:bg-slate-50:hover { background-color: #1e293b !important; }
html.dark .hover\:bg-slate-100:hover { background-color: #334155 !important; }
html.dark .bg-slate-50 { background-color: #1e293b !important; }
html.dark input,
html.dark textarea,
html.dark select { background-color: #334155; border-color: #475569; color: #e2e8f0; }
html.dark .bg-emerald-50 { background-color: rgba(6, 95, 70, 0.2) !important; }
html.dark .bg-red-50 { background-color: rgba(153, 27, 27, 0.2) !important; }
html.dark .bg-amber-50 { background-color: rgba(146, 64, 14, 0.2) !important; }
html.dark .bg-blue-50 { background-color: rgba(30, 64, 175, 0.2) !important; }
html.dark .bg-purple-50 { background-color: rgba(88, 28, 135, 0.2) !important; }
html.dark .alert-success { background: rgba(6, 95, 70, 0.3); border-color: #6ee7b7; color: #6ee7b7; }
html.dark .alert-error { background: rgba(153, 27, 27, 0.3); border-color: #fca5a5; color: #fca5a5; }
html.dark .alert-warning { background: rgba(146, 64, 14, 0.3); border-color: #fcd34d; color: #fcd34d; }
html.dark .alert-info { background: rgba(30, 64, 175, 0.3); border-color: #93c5fd; color: #93c5fd; }

/* ============================================================
   Prose (rich-text article content) — LIGHT mode first.
   Required for blog articles: Tailwind CDN has no typography
   plugin, so h2/h3/p/ul/table inside .prose would render flat.
   ============================================================ */
.prose { color: #334155; font-size: 1.02rem; line-height: 1.8; overflow-wrap: break-word; }
.prose h2 { font-size: 1.5rem; font-weight: 800; color: #0f172a; margin: 2.25rem 0 0.75rem; line-height: 1.3; }
.prose h2:first-child { margin-top: 0.5rem; }
.prose h3 { font-size: 1.22rem; font-weight: 700; color: #1e293b; margin: 1.75rem 0 0.5rem; line-height: 1.35; }
.prose h4 { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin: 1.4rem 0 0.5rem; }
.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.6rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0 0 0.45rem; }
.prose li::marker { color: #0ea5e9; font-weight: 600; }
.prose a { color: #0284c7; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-weight: 500; }
.prose a:hover { color: #0369a1; }
.prose strong { color: #0f172a; font-weight: 700; }
.prose em { font-style: italic; }
.prose blockquote {
    border-left: 4px solid #7dd3fc;
    background: #f0f9ff;
    color: #0c4a6e;
    padding: 0.85rem 1.1rem;
    margin: 0 0 1.15rem;
    border-radius: 0 10px 10px 0;
    font-style: normal;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.3rem; font-size: 0.93rem; display: block; overflow-x: auto; }
.prose thead th { background: #f1f5f9; text-align: left; font-weight: 700; color: #0f172a; }
.prose th, .prose td { border: 1px solid #e2e8f0; padding: 0.55rem 0.8rem; vertical-align: top; }
.prose tbody tr:nth-child(even) { background: #f8fafc; }

/* Prose (rich text) in dark mode */
html.dark .prose { color: #cbd5e1; }
html.dark .prose h2, html.dark .prose h3 { color: #f1f5f9; }
html.dark .prose a { color: #38bdf8; }
html.dark .prose blockquote { border-left-color: #475569; color: #94a3b8; }
html.dark .prose code { background: #334155; color: #f87171; }
html.dark .prose h4 { color: #f1f5f9; }
html.dark .prose strong { color: #f8fafc; }
html.dark .prose thead th { background: #334155; color: #f1f5f9; }
html.dark .prose th, html.dark .prose td { border-color: #475569; }
html.dark .prose tbody tr:nth-child(even) { background: rgba(51, 65, 85, 0.35); }
html.dark .prose blockquote { background: rgba(14, 165, 233, 0.08); }
html.dark .prose li::marker { color: #38bdf8; }

/* Admin sidebar dark mode */
html.dark .admin-sidebar-link { color: #94a3b8 !important; }
html.dark .admin-sidebar-link:hover { background: #334155 !important; color: #e2e8f0 !important; }
html.dark .admin-sidebar-link.active { background: rgba(14,165,233,0.15) !important; color: #38bdf8 !important; }

/* Additional dark mode elements */
html.dark .hero-gradient {
    background: radial-gradient(1200px 600px at 100% 0%, rgba(14,165,233,0.15), transparent 60%),
                radial-gradient(800px 400px at 0% 100%, rgba(37,99,235,0.15), transparent 60%) !important;
}
html.dark .stat-tile {
    background: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(37,99,235,0.1)) !important;
    border-color: #334155 !important;
}
html.dark .icon-circle {
    background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(37,99,235,0.15)) !important;
    color: #38bdf8 !important;
}
html.dark .badge-pending { background: rgba(146,64,14,0.3) !important; color: #fcd34d !important; }
html.dark .badge-approved { background: rgba(6,95,70,0.3) !important; color: #6ee7b7 !important; }
html.dark .badge-rejected { background: rgba(153,27,27,0.3) !important; color: #fca5a5 !important; }
html.dark .text-slate-500 { color: #64748b !important; }
html.dark .bg-cyan-50 { background-color: rgba(8,145,178,0.2) !important; }
html.dark .cta-outline { border-color: #475569 !important; background: rgba(30,41,59,0.6) !important; color: #e2e8f0 !important; }

/* ============================================================
   v13 — AdBlock Guard overlay (watch pages)
   ============================================================ */
.ab-guard-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.ab-guard-overlay[hidden] { display: none; }
.ab-guard-box {
    background: #fff; border-radius: 20px; max-width: 26rem; width: 100%;
    padding: 2.25rem 2rem; text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    border-top: 5px solid #0ea5e9;
}
.ab-guard-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee, #2563eb);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.6rem;
}
.ab-guard-title { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin: 0 0 0.6rem; }
.ab-guard-text { color: #475569; font-size: 0.95rem; line-height: 1.65; margin: 0 0 1.4rem; }
.ab-guard-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: linear-gradient(90deg, #06b6d4, #2563eb);
    color: #fff; font-weight: 700; font-size: 0.95rem;
    padding: 0.8rem 1.6rem; border-radius: 9999px;
    border: none; cursor: pointer; transition: transform .15s, box-shadow .15s;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}
.ab-guard-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45); }
.ab-guard-alt { display: block; margin-top: 0.9rem; font-size: 0.8rem; color: #94a3b8; text-decoration: underline; text-underline-offset: 2px; }
.ab-guard-alt:hover { color: #64748b; }
html.dark .ab-guard-box { background: #1e293b; }
html.dark .ab-guard-title { color: #f1f5f9; }
html.dark .ab-guard-text { color: #94a3b8; }

/* ============================================================
   v13.7 — Rich description editor (full toolbar) + rendered
   rich description on the public product page
   ============================================================ */
.desc-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e5e7eb; border-bottom: 0;
  border-radius: 0.5rem 0.5rem 0 0;
  background: #f9fafb;
}
.desc-toolbar button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.875rem; height: 1.875rem; padding: 0 0.375rem;
  border-radius: 0.375rem; border: 1px solid transparent;
  background: transparent; color: #4b5563;
  font-size: 0.8125rem; font-weight: 700;
  cursor: pointer; transition: background .12s, color .12s;
}
.desc-toolbar button:hover { background: #f3f4f6; color: #111827; }
.desc-toolbar button[aria-pressed="true"] { background: #e0f2fe; color: #0369a1; }
.desc-toolbar .sep { width: 1px; height: 1.25rem; background: #e5e7eb; margin: 0 0.3rem; flex-shrink: 0; }
.desc-block-select {
  height: 1.875rem; padding: 0 0.5rem;
  border: 1px solid #e5e7eb; border-radius: 0.375rem;
  background: #fff; color: #374151;
  font-size: 0.75rem; font-weight: 600;
  outline: none; cursor: pointer; margin-right: 0.125rem;
}
.desc-block-select:focus { border-color: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,.15); }
.desc-editor-area {
  min-height: 400px; max-height: 720px; overflow-y: auto;
  padding: 1rem 1.1rem;
  border: 1px solid #e5e7eb; border-radius: 0 0 0.5rem 0.5rem;
  background: #fff; color: #111827;
  outline: none; font-size: 0.875rem; line-height: 1.75;
}
.desc-editor-area:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.desc-editor-area:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.desc-editor-area h2 { font-size: 1.3rem; font-weight: 800; margin: 1.1rem 0 0.5rem; }
.desc-editor-area h3 { font-size: 1.1rem; font-weight: 700; margin: 0.9rem 0 0.4rem; }
.desc-editor-area h4 { font-size: 0.95rem; font-weight: 700; margin: 0.75rem 0 0.35rem; }
.desc-editor-area p { margin: 0.5rem 0; }
.desc-editor-area ul, .desc-editor-area ol { padding-left: 1.4rem; margin: 0.5rem 0; }
.desc-editor-area ul { list-style: disc; }
.desc-editor-area ol { list-style: decimal; }
.desc-editor-area li { margin: 0.25rem 0; }
.desc-editor-area a { color: #0284c7; text-decoration: underline; }
.desc-editor-area blockquote { border-left: 3px solid #cbd5e1; padding-left: 0.9rem; color: #64748b; margin: 0.6rem 0; }
.desc-editor-area hr { border: 0; border-top: 1px solid #e5e7eb; margin: 1rem 0; }
.desc-editor-area table { border-collapse: collapse; margin: 0.6rem 0; }
.desc-editor-area td, .desc-editor-area th { border: 1px solid #cbd5e1; padding: 0.35rem 0.6rem; min-width: 2.5rem; }
.desc-editor-area img { max-width: 100%; border-radius: 0.375rem; }
.desc-counter { display: block; margin-top: 0.35rem; font-size: 0.7rem; color: #94a3b8; }
.desc-hidden-field { display: none !important; }

/* color / highlight palettes */
.desc-popover {
  display: none; position: absolute; z-index: 40;
  grid-template-columns: repeat(8, 1.25rem); gap: 0.25rem;
  padding: 0.5rem; margin-top: 0.25rem;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(15,23,42,.12);
}
.desc-popover.open { display: grid; }
.desc-popover .desc-swatch {
  width: 1.25rem; height: 1.25rem; padding: 0;
  border-radius: 0.25rem; border: 1px solid rgba(15,23,42,.15);
  cursor: pointer;
}
.desc-popover .desc-swatch:hover { transform: scale(1.12); border-color: #0ea5e9; }
.desc-popover .desc-swatch-clear {
  grid-column: 1 / -1; justify-content: flex-start !important;
  height: 1.75rem; padding: 0 0.5rem;
  border-radius: 0.375rem; background: #f9fafb; color: #4b5563;
  font-size: 0.7rem; gap: 0.4rem;
}
.desc-popover .desc-swatch-clear:hover { background: #f3f4f6; color: #111827; }
.desc-toolbar-group { position: relative; display: inline-flex; }

html.dark .desc-toolbar { background: #1e293b; border-color: #334155; }
html.dark .desc-toolbar button { background: transparent; color: #cbd5e1; }
html.dark .desc-toolbar button:hover { background: #475569; color: #f8fafc; }
html.dark .desc-toolbar button[aria-pressed="true"] { background: #0ea5e9; color: #fff; }
html.dark .desc-toolbar .sep { background: #475569; }
html.dark .desc-block-select { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .desc-editor-area { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .desc-popover { background: #1e293b; border-color: #334155; }
html.dark .desc-popover .desc-swatch-clear { background: #0f172a; color: #cbd5e1; }

/* Rendered rich description on the public product page */
.rich-desc h2 { font-size: 1.2rem; font-weight: 800; margin: 1.25rem 0 0.5rem; color: #0f172a; line-height: 1.35; }
.rich-desc h3 { font-size: 1.05rem; font-weight: 700; margin: 1rem 0 0.4rem; color: #0f172a; }
.rich-desc h4 { font-size: 0.95rem; font-weight: 700; margin: 0.9rem 0 0.35rem; color: #0f172a; }
.rich-desc p { margin: 0.6rem 0; }
.rich-desc ul, .rich-desc ol { padding-left: 1.4rem; margin: 0.6rem 0; }
.rich-desc ul { list-style: disc; }
.rich-desc ol { list-style: decimal; }
.rich-desc li { margin: 0.3rem 0; }
.rich-desc a { color: #0284c7; text-decoration: underline; }
.rich-desc a:hover { color: #0369a1; }
.rich-desc blockquote { border-left: 3px solid #cbd5e1; padding-left: 0.9rem; color: #64748b; margin: 0.75rem 0; }
.rich-desc code { background: #f1f5f9; border-radius: 0.25rem; padding: 0.1rem 0.35rem; font-size: 0.8em; font-family: ui-monospace, monospace; }
.rich-desc pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.75rem 1rem; overflow-x: auto; margin: 0.75rem 0; }
.rich-desc pre code { background: none; padding: 0; }
.rich-desc s { text-decoration: line-through; color: #64748b; }
.rich-desc sub, .rich-desc sup { font-size: 0.75em; }
.rich-desc hr { border: 0; border-top: 1px solid #e2e8f0; margin: 1.25rem 0; }
.rich-desc mark { background: #fef08a; border-radius: 0.2rem; padding: 0.05rem 0.2rem; }
.rich-desc table { border-collapse: collapse; margin: 0.9rem 0; width: auto; max-width: 100%; overflow-x: auto; display: block; }
.rich-desc th, .rich-desc td { border: 1px solid #cbd5e1; padding: 0.4rem 0.75rem; text-align: left; vertical-align: top; }
.rich-desc th { background: #f8fafc; font-weight: 700; }
.rich-desc img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 0.5rem 0; }
.plain-desc { white-space: normal; }
html.dark .rich-desc h2, html.dark .rich-desc h3, html.dark .rich-desc h4 { color: #f1f5f9; }
html.dark .rich-desc blockquote { border-color: #475569; color: #94a3b8; }
html.dark .rich-desc code { background: #1e293b; }
html.dark .rich-desc pre { background: #1e293b; border-color: #334155; }
