/* --- MISSIONS GUILD COMPLETE DESIGN SYSTEM --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #a6812f;
    --primary-dark: #7a5f22;
    --primary-light: #faf3e0;
    --accent: #1c1712;
    --surface: #f8f4ea;
    --card-bg: #ffffff;
    --text: #1c1712;
    --text-dim: #6b6255;
    --border: #e6dcc6;
    --admin: #f43f5e;
    --success: #10b981;
    --shadow: 0 10px 15px -3px rgba(28, 23, 18, 0.08), 0 4px 6px -2px rgba(28, 23, 18, 0.04);
    --radius: 20px;

    /* Note Colors */
    --note-yellow: #fef9c3;
    --note-cyan: #cffafe;
    --note-pink: #fce7f3;
    --note-green: #dcfce7;
}

* {
    box-sizing: border-box;
    transition: all 0.2s ease;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: radial-gradient(at top left, #fffdf7, #efe5cd);
    background-attachment: fixed;
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto; /* Fix: Allows entire page to scroll naturally */
    min-height: 100vh;
}

/* --- NAVIGATION --- */
.glass-nav {
    position: sticky;
    top: 15px;
    width: 95%;
    max-width: 1400px;
    margin: 15px auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text);
}

.nav-brand span { color: var(--primary); }

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-token {
    background: var(--text);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* --- LAYOUT --- */
.container {
    max-width: 1400px;
    margin: 20px auto 100px;
    padding: 0 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 30px;
    align-items: start;
}

.scroll-viewport {
    padding-bottom: 30px;
}

/* --- PRAYER WALL --- */
.prayer-wall-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 80px;
}

.prayer-note {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
}

.prayer-note::before {
    content: "🙏";
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prayer-note > div:first-of-type {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.prayer-note:nth-child(4n+1) { border-left-color: #f59e0b; }
.prayer-note:nth-child(4n+2) { border-left-color: #06b6d4; }
.prayer-note:nth-child(4n+3) { border-left-color: #ec4899; }
.prayer-note:nth-child(4n+4) { border-left-color: #10b981; }

.prayer-note:hover {
    /* !important needed: the note-enter entrance animation's fill-mode holds its
       final transform on the element indefinitely (the class is never removed),
       which otherwise silently wins over a plain hover transform. */
    transform: translateX(3px) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
    /* note: don't touch border-color here — border-left carries the per-note accent color */
}

.note-footer {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    padding-top: 0;
}

/* Public profile's plain "record a prayer" button (no .note-btn class there) */
.note-footer button {
    background: var(--primary-light);
    border: none;
    border-radius: 9px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.note-footer button:hover {
    background: var(--primary);
    transform: translateY(-2px) scale(1.06);
}

.edit-mini-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: bold;
    transition: 0.2s;
}

.edit-mini-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

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

/* --- BLOCK EDITOR: drag-and-drop, insert points, counters --- */
.block-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: default;
}

.block-drag-handle {
    position: absolute;
    top: 14px;
    left: 4px;
    color: var(--text-dim);
    cursor: grab;
    font-size: 1rem;
    line-height: 1;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.block-card:hover .block-drag-handle { opacity: 1; }
.block-card[draggable="true"]:active .block-drag-handle { cursor: grabbing; }

.block-dragging {
    opacity: 0.4;
    transform: scale(0.98);
}

.block-drop-above { box-shadow: 0 -3px 0 0 var(--primary); }
.block-drop-below { box-shadow: 0 3px 0 0 var(--primary); }

.block-insert-point {
    position: relative;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-insert-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 2;
}

.block-insert-point:hover .block-insert-btn,
.block-insert-point:focus-within .block-insert-btn {
    opacity: 1;
    transform: scale(1);
}

.block-insert-menu {
    display: none;
    position: absolute;
    top: 24px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    gap: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 5;
}

.block-insert-menu.open { display: flex; }

.block-insert-menu button {
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.block-insert-menu button:hover { background: var(--primary-light); }

.char-counter {
    text-align: right;
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 4px;
    font-weight: 600;
}

.field-warning {
    font-size: 0.65rem;
    color: #ef4444;
    font-weight: 700;
    margin-top: 4px;
}

.media-fade {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.media-fade.loaded {
    opacity: 1;
}

/* --- POSTS & TEMPLATES --- */

/* --- UI ELEMENTS --- */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.glow-btn {
    background: var(--primary);
    color: white !important;
    border: none;
    padding: 12px 26px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.save-post-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 16px rgba(0,0,0,.15);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-dim);
    transition: transform .15s ease, background .15s ease, color .15s ease;
}
.save-post-btn:hover { transform: translateY(-2px) scale(1.05); background: #fff; }
.save-post-btn.is-saved { color: var(--primary); }

.load-more-btn {
    width: 100%;
    padding: 18px;
    background: white;
    border: 2px dashed var(--border);
    color: var(--text-dim);
    cursor: pointer;
    font-weight: 700;
    border-radius: 15px;
    margin-top: 10px;
}

.stat-card {
    background: white;
    padding: 18px 28px;
    border-radius: 18px;
    border: 1px solid var(--border);
    min-width: 140px;
    text-align: center;
    box-shadow: var(--shadow);
    flex: 1;
}

.stat-card h2 { margin: 5px 0 0 0; font-size: 1.8rem; font-weight: 800; color: var(--primary); }

/* --- HALL OF PRAISE MODAL SPECIFICS --- */
.archive-scroll-area {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px;
    margin: 20px 0;
}

.archive-scroll-area::-webkit-scrollbar { width: 6px; }
.archive-scroll-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.praise-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 5px solid var(--success);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.praise-card .icon {
    background: var(--success);
    color: white;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.9rem;
}

/* --- MODALS --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.modal-content {
    background: #fdfbf5;
    width: 95%;
    max-width: 1000px;
    border-radius: 28px;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close { position: absolute; top: 25px; right: 30px; font-size: 1.8rem; cursor: pointer; color: var(--text-dim); }

input, textarea, select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    font-family: inherit;
    font-size: 1rem;
}

@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .post-spotlight { grid-template-columns: 1fr; }
}