/* ================================================
   PostCampaign — Light Theme
   Clean, minimal, professional
   ================================================ */

:root {
    --brand:       #2563eb;
    --brand-light: #3b82f6;
    --brand-glow:  rgba(59,130,246,0.15);
    --accent:      #f59e0b;
    --green:       #16a34a;
    --red:         #dc2626;
    --bg:          #f8fafc;
    --surface:     #ffffff;
    --surface-2:   #f1f5f9;
    --surface-3:   #e2e8f0;
    --border:      #e2e8f0;
    --border-soft: #f1f5f9;
    --text:        #0f172a;
    --text-muted:  #475569;
    --text-dim:    #94a3b8;
    --radius:      14px;
    --radius-sm:   9px;
    --radius-lg:   20px;
    --nav-h:       60px;
    --tab-h:       68px;
    --font-body:   'Inter', system-ui, sans-serif;
    --font-display:'Inter', system-ui, sans-serif;
    --shadow:      0 1px 6px rgba(15,23,42,0.08), 0 4px 16px rgba(15,23,42,0.04);
    --shadow-brand: 0 0 0 3px rgba(59,130,246,0.15);
}

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

body { font-family: var(--font-body); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 2px; }

/* ── AUTH PAGES ── */
.auth-body {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
    color: var(--text);
}

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-control {
    width: 100%;
    background: var(--surface) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    font-family: var(--font-body);
    font-size: 15px;
    padding: 11px 14px !important;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--brand) !important;
    box-shadow: var(--shadow-brand) !important;
    outline: none !important;
}

.form-control::placeholder { color: var(--text-dim); }

textarea.form-control { resize: vertical; min-height: 100px; }

.btn-primary-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 24px;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    letter-spacing: 0.1px;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary-app:hover  { background: #1d4ed8; }
.btn-primary-app:active { transform: scale(0.98); }

.auth-link {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-link a { color: var(--brand); text-decoration: none; font-weight: 600; }

.error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

/* ── APP LAYOUT ── */
.app-body {
    min-height: 100dvh;
    padding-top: var(--nav-h);
    padding-bottom: var(--tab-h);
    background: var(--bg);
}

/* ── TOP NAV ── */
.app-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.3px;
}
.brand-dot {
    width: 7px; height: 7px;
    background: var(--brand);
    border-radius: 50%;
}
.btn-nav-ghost {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.18s, background 0.18s;
}
.btn-nav-ghost:hover { color: var(--text); background: var(--surface-3); }

/* ── MAIN CONTENT ── */
.app-main { padding: 20px 16px; min-height: calc(100dvh - var(--nav-h) - var(--tab-h)); }

/* ── BOTTOM TAB BAR ── */
.bottom-tab-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--tab-h);
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 8px 20px;
    border-radius: 10px;
    transition: color 0.18s, background 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.tab-item i { font-size: 20px; }
.tab-item.active { color: var(--brand); }
.tab-item:active { background: var(--surface-2); }

/* ── TOAST ALERTS ── */
.toast-alert {
    position: fixed;
    top: 70px; left: 16px; right: 16px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    z-index: 999;
    animation: slideDown 0.3s ease, fadeOut 0.4s ease 2.8s forwards;
}
.toast-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.toast-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
@keyframes slideDown { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut   { to { opacity: 0; pointer-events: none; } }

/* ── FEED ── */
.feed-header { margin-bottom: 20px; }
.feed-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.15;
    color: var(--text);
}
.feed-title span { color: var(--brand); }
.feed-subtitle { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.posts-grid { display: flex; flex-direction: column; gap: 14px; }

/* ── POST CARD ── */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.post-card:hover, .post-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(15,23,42,0.1);
    border-color: #bfdbfe;
    color: var(--text);
}
.post-card-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.post-card-img-placeholder {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}
.post-card-body { padding: 16px; }
.post-card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--text);
}
.post-card-caption {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}
.post-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.post-tag {
    background: #eff6ff;
    color: var(--brand);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
}
.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.post-cta-mini {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 7px;
    transition: background 0.18s;
}
.post-cta-mini:hover { background: #1d4ed8; color: #fff; }
.post-date { font-size: 12px; color: var(--text-dim); }

/* ── POST DETAIL ── */
.post-detail-img {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 18px;
    display: block;
    border: 1px solid var(--border);
}
.post-detail-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
    color: var(--text);
}
.post-detail-caption {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 14px;
}
.post-detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.post-detail-tag {
    background: #eff6ff;
    color: var(--brand);
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 600;
}
.post-url-preview {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 13px;
    word-break: break-all;
}
.post-url-preview i { color: var(--brand); font-size: 15px; flex-shrink: 0; }

/* ── BIG CTA BUTTON ── */
.btn-post-fb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    padding: 17px 24px;
    cursor: pointer;
    letter-spacing: 0.1px;
    transition: background 0.18s, transform 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.btn-post-fb:hover  { background: #1d4ed8; }
.btn-post-fb:active { transform: scale(0.98); }
.btn-post-fb .fb-icon { font-size: 20px; }

/* ── BOTTOM SHEET ── */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
}
.bottom-sheet {
    width: 100%;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--border);
    padding: 0 20px 32px;
    max-height: 92dvh;
    overflow-y: auto;
    animation: sheetUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.sheet-handle {
    width: 36px; height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    margin: 12px auto 18px;
}
.sheet-success-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
}
.sheet-success-icon {
    width: 34px; height: 34px;
    background: var(--green);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}
.sheet-success-text strong { display: block; font-size: 14px; color: #15803d; font-weight: 700; }
.sheet-success-text span { font-size: 13px; color: var(--text-muted); }

.sheet-image-preview {
    width: 100%;
    border-radius: var(--radius);
    max-height: 200px;
    object-fit: cover;
    margin-bottom: 18px;
    display: block;
    border: 1px solid var(--border);
}
.sheet-image-placeholder {
    width: 100%;
    height: 120px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 18px;
}
.sheet-image-placeholder i { font-size: 26px; }

.sheet-steps-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 10px;
}
.sheet-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.sheet-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
}
.step-num {
    width: 22px; height: 22px;
    background: var(--brand);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}
.step-text { font-size: 14px; color: var(--text-muted); line-height: 1.4; padding-top: 1px; }
.step-text strong { color: var(--text); }

.sheet-actions { display: flex; flex-direction: column; gap: 9px; }
.btn-sheet-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #1877f2;
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-sheet-primary:hover { background: #166fe5; color: #fff; }
.btn-sheet-primary:active { transform: scale(0.98); }

.btn-sheet-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-sheet-secondary:hover { background: var(--surface-3); color: var(--text); }
.btn-sheet-secondary:active { transform: scale(0.98); }
.btn-sheet-secondary.copied { color: var(--green); border-color: #bbf7d0; background: #f0fdf4; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 44px; margin-bottom: 14px; }
.empty-state h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text); }
.empty-state p { font-size: 14px; margin-top: 6px; }

/* ── UTILITY ── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 18px;
    transition: color 0.18s;
}
.back-link:hover { color: var(--text); }

/* ── PROOF SUBMISSION (bottom sheet) ── */
.proof-divider {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    margin: 18px 0 14px;
    padding-top: 18px;
}

.proof-form { display: flex; flex-direction: column; gap: 13px; }
.proof-field { display: flex; flex-direction: column; gap: 6px; }
.proof-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.proof-url-msg {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 2px;
}
.proof-url-ok  { color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; }
.proof-url-err { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }

.proof-upload-area {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    background: var(--surface-2);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    padding: 18px;
}
.proof-upload-area:hover,
.proof-upload-area.has-file {
    border-color: #93c5fd;
    background: #eff6ff;
}

.proof-error {
    font-size: 13px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 13px;
    font-weight: 600;
}

.proof-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    margin-bottom: 8px;
}

/* Spin animation */
@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { display: inline-block; animation: spin 0.7s linear infinite; }
