/* =========================================
   THREDOPS GLOBAL STYLESHEET
   ========================================= */

/* 1. BASE & TYPOGRAPHY */
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; 
    background: #f4f5f7; 
    padding: 40px; 
    margin: 0; 
    color: #111; 
}
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}
h1 { 
    font-size: 2.5rem; 
    margin-bottom: 5px; 
    font-weight: 800; 
    letter-spacing: -0.02em; 
}
h2 { 
    font-size: 1.8rem; 
    margin-top: 40px; 
    margin-bottom: 10px; 
    border-top: 2px solid #eaeaea; 
    padding-top: 40px; 
}
.subtitle { 
    color: #64748b; 
    margin-bottom: 40px; 
    font-size: 1.1rem; 
}

/* 2. UNIVERSAL NAVIGATION (THREDOPS BRANDING) */
.nav-bar { 
    margin-bottom: 40px; 
    display: grid; 
    grid-template-columns: 1fr auto 1fr; 
    align-items: center; 
    background: #fff; 
    padding: 12px 25px; 
    border-radius: 12px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.02); 
    border: 1px solid #eee; 
    gap: 15px;
}

@media (max-width: 1024px) {
    .nav-bar { display: flex; flex-wrap: wrap; justify-content: center; }
}

.brand-group { display: flex; align-items: center; gap: 12px; text-decoration: none; justify-self: start; }
.logo-box { background: #0f172a; color: #fff; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; font-family: monospace; }
.brand-name { font-weight: 800; font-size: 1.3rem; color: #0f172a; letter-spacing: -0.03em; }
.brand-name span { color: #3b82f6; }

.nav-links-group { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    justify-content: center; 
    justify-self: center;
}
.nav-links-group a { text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; transition: 0.2s; color: #475569; }
.nav-links-group a:hover { background: #f1f5f9; color: #0f172a; }
.nav-links-group .nav-active { background: #0f172a; color: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
    justify-self: end;
}

.ai-persona-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #475569;
    max-width: 160px;
}
.ai-persona-pill span:last-child {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    background: #fff; 
    padding: 4px 14px 4px 4px; 
    border-radius: 30px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.user-badge img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); object-fit: cover; }
.user-handle { font-size: 0.9rem; font-weight: 700; color: #0f172a; }

/* 3. UNIVERSAL UI ELEMENTS (CARDS & BUTTONS) */
.card, .workspace-card, .settings-card, .kpi-card, .chart-container, .table-container { 
    background: #fff; 
    border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
    border: 1px solid #f1f5f9; 
    position: relative;
}
.card-title, .kpi-title { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin-bottom: 20px; }

.action-btn { background: #3b82f6; color: #fff; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 1rem; transition: 0.2s; text-decoration: none; text-align: center;}
.action-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-success { background: #10b981; }
.btn-danger { background: #ef4444; }
.btn-warning { background: #f59e0b; color: #fff; }

/* 4. COMMAND CENTRE (DASHBOARD) SPECIFIC */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; }
.kpi-card { padding: 30px; }
.kpi-title { font-size: 0.95rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.kpi-value { font-size: 3rem; font-weight: 800; color: #0f172a; line-height: 1; }

.chart-container { padding: 30px; margin-bottom: 40px; height: 350px; }
.table-container { overflow: hidden; padding: 0; }

.table-header { display: grid; grid-template-columns: 3fr 2fr 1fr; padding: 20px 25px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-weight: 700; color: #475569; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.post-row { display: grid; grid-template-columns: 3fr 2fr 1fr; padding: 25px; border-bottom: 1px solid #f1f5f9; align-items: center; transition: 0.2s; }
.post-row:hover { background: #f8fafc; }
.post-row:last-child { border-bottom: none; }
.post-hook { font-weight: 600; font-size: 1.05rem; color: #0f172a; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-date { font-size: 0.85rem; color: #94a3b8; }

.metrics-flex { display: flex; gap: 12px; flex-wrap: wrap; }
.metric-pill { display: flex; align-items: center; gap: 6px; background: #f1f5f9; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; color: #475569; }
.metric-pill.views { background: #e0f2fe; color: #0369a1; }
.metric-pill.likes { background: #fce7f3; color: #be185d; }
.metric-pill.replies { background: #fef3c7; color: #b45309; }

.eng-badge { padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 1rem; text-align: center; display: inline-block; }
.eng-high { background: #dcfce7; color: #166534; }
.eng-med { background: #fef3c7; color: #b45309; }
.eng-low { background: #f1f5f9; color: #64748b; }

.sync-badge { background: #e2e8f0; color: #475569; padding: 10px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; display: flex; align-items: center; gap: 8px; border: 1px solid #cbd5e1; }
.sync-dot { display: inline-block; width: 8px; height: 8px; background: #10b981; border-radius: 50%; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

/* 5. GLOBAL QUICK DRAFT WIDGET */
.fab-quick-draft {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0f172a;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: 0.3s;
    border: 2px solid #fff;
}
.fab-quick-draft:hover {
    transform: translateY(-5px) scale(1.05);
    background: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}
.global-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.global-modal {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid #e2e8f0;
}

/* 6. QUEUE & DRAFTS LIST ITEMS (Shared) */
.queue-container { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f1f5f9; overflow: hidden; margin-bottom: 40px; }
.queue-item { padding: 20px; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; gap: 20px; transition: transform 0.1s, box-shadow 0.1s; }
.post-content-wrapper { flex: 1; }
.post-text { font-size: 1rem; color: #0f172a; white-space: pre-wrap; margin: 0 0 10px 0; line-height: 1.4; }
.post-meta { font-size: 0.85rem; color: #64748b; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge { padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.75rem; text-transform: uppercase; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-published { background: #dcfce7; color: #166534; }
.status-failed { background: #fee2e2; color: #b91c1c; }
.status-draft { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.cat-badge { padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.75rem; text-transform: uppercase; background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; display: inline-block; } 
.cat-General { background: #e2e8f0; color: #475569; border-color: transparent; }
.cat-Thought-Leadership { background: #dbeafe; color: #1e40af; border-color: transparent; }
.cat-News-Updates { background: #ffedd5; color: #c2410c; border-color: transparent; }
.cat-Promo-Offer { background: #fce7f3; color: #be185d; border-color: transparent; }
.cat-Personal-Story { background: #f3e8ff; color: #7e22ce; border-color: transparent; }
.delete-btn { background: #ef4444; color: white; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 0.85rem; }
.delete-btn:hover { background: #dc2626; }
.edit-btn { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 0.85rem; transition: 0.2s; }
.edit-btn:hover { background: #e2e8f0; color: #0f172a; }
.section-title { font-size: 1.2rem; color: #0f172a; margin-bottom: 25px; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; }
.empty-state { padding: 30px; text-align: center; color: #94a3b8; }

/* 7. QUEUE TOGGLE & WEEK VIEW */
.view-toggle { display: inline-flex; background: #e2e8f0; border-radius: 8px; padding: 4px; }
.view-btn { padding: 6px 16px; border: none; background: transparent; border-radius: 6px; cursor: pointer; font-weight: bold; color: #64748b; transition: 0.2s; font-size: 0.9rem; }
.view-btn.active { background: #fff; color: #0f172a; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 15px; padding-bottom: 15px; min-width: 1000px; }
.day-column { background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; overflow: hidden; }
.day-header { padding: 12px 10px; text-align: center; border-bottom: 1px solid #e2e8f0; font-weight: bold; color: #0f172a; background: #f1f5f9; font-size: 0.95rem; }
.week-dropzone { padding: 10px; min-height: 60px; border-bottom: 1px dashed #e2e8f0; display: flex; flex-direction: column; gap: 8px; }
.week-dropzone:last-child { border-bottom: none; }

.week-item { background: #fff; border: 1px solid #cbd5e1; padding: 12px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.2s; position: relative; }
.week-item:hover { border-color: #3b82f6; box-shadow: 0 4px 8px rgba(59, 130, 246, 0.1); }
.week-item .drag-handle-mini { position: absolute; top: 10px; right: 10px; color: #cbd5e1; cursor: grab; font-size: 1rem; }
.week-item .drag-handle-mini:hover { color: #3b82f6; }

.week-empty-slot { background: transparent; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 10px; text-align: center; color: #64748b; font-size: 0.85rem; font-weight: bold; cursor: pointer; transition: 0.2s; }
.week-empty-slot:hover { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; }

/* =========================================
   8. NEW SAAS LAYOUT (SIDEBAR NAVIGATION)
   ========================================= */
body.app-body { padding: 0; background: #f8fafc; height: 100vh; overflow: hidden; display: flex; }

.sidebar-nav {
    width: 260px;
    background: #0f172a;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    transition: 0.3s;
}

.sidebar-header { padding: 25px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 15px; }
.sidebar-header .brand-name { color: #fff; font-size: 1.4rem; }

.sidebar-menu { flex: 1; overflow-y: auto; padding: 0 15px; display: flex; flex-direction: column; gap: 5px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px;
    color: #cbd5e1; text-decoration: none; border-radius: 8px;
    font-weight: 600; font-size: 0.95rem; transition: 0.2s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-link.active { background: #3b82f6; color: #fff; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }

.sidebar-footer { padding: 20px 15px; border-top: 1px solid rgba(255,255,255,0.05); }

.main-workspace {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
}

/* =========================================
   9. SETTINGS TAB LAYOUT
   ========================================= */
.settings-layout { display: flex; gap: 30px; max-width: 1000px; align-items: flex-start; }
.settings-menu { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 5px; }

.settings-tab-btn {
    text-align: left; background: transparent; border: none; padding: 12px 15px;
    font-size: 0.95rem; font-weight: bold; color: #64748b; border-radius: 8px;
    cursor: pointer; transition: 0.2s;
}
.settings-tab-btn:hover { background: #e2e8f0; color: #0f172a; }
.settings-tab-btn.active { background: #fff; color: #3b82f6; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.settings-content-area { flex: 1; min-width: 0; }
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }

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

/* Danger Zone */
.danger-zone { border: 1px solid #fecaca; background: #fff5f5; padding: 20px; border-radius: 12px; margin-top: 30px; }

/* ========================================= */
/* THREDOPS HOMEPAGE & SAAS OVERRIDES        */
/* ========================================= */

/* The Energetic CTA Button */
.btn-primary { background: #3b82f6; color: white; padding: 16px 32px; border-radius: 8px; font-weight: 700; text-decoration: none; transition: 0.2s; display: inline-block; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); border: none; }
.btn-primary:hover { background: #2563eb; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4); }

.hero-section { position: relative; max-width: 950px; margin: 120px auto 80px; text-align: center; padding: 0 20px; z-index: 1; }
.hero-headline { font-size: 5rem; color: #0f172a; margin-bottom: 24px; line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; } 
.hero-sub { font-size: 1.25rem; color: #475569; line-height: 1.6; max-width: 700px; margin: 0 auto 40px; font-weight: 400; }
.trust-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; color: #475569; font-weight: 600; margin-top: 35px; background: #ffffff; padding: 10px 20px; border-radius: 30px; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }

.floating-pill { position: absolute; background: white; border: 1px solid #e2e8f0; padding: 12px 20px; border-radius: 30px; box-shadow: 0 15px 35px rgba(15, 23, 42, 0.05); font-size: 0.95rem; font-weight: 600; color: #475569; display: flex; align-items: center; gap: 10px; animation: float-animation 6s ease-in-out infinite; z-index: -1; opacity: 0.9; white-space: nowrap; }
@keyframes float-animation { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }
.pill-1 { top: 10%; left: -5%; animation-delay: 0s; }
.pill-2 { top: 60%; right: -10%; animation-delay: 2s; }
.pill-3 { bottom: -15%; left: 10%; animation-delay: 4s; }
.pill-4 { top: 5%; right: 0%; animation-delay: 1.5s; }

.feature-section { padding: 60px 20px; max-width: 1200px; margin: 0 auto; }
.zig-zag-row { display: flex; align-items: center; gap: 80px; margin-bottom: 120px; }
.zig-zag-row.reverse { flex-direction: row-reverse; }
.feature-text { flex: 1; }
.feature-text h2 { font-size: 2.4rem; font-weight: 800; line-height: 1.15; margin-bottom: 20px; color: #0f172a; border: none; padding: 0; letter-spacing: -0.03em; }
.feature-text p { font-size: 1.1rem; color: #475569; line-height: 1.7; margin-bottom: 25px; font-weight: 400; }

.feature-image-wrapper { flex: 1; position: relative; }
.feature-mockup { width: 100%; border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; background: #fff; padding: 25px; box-sizing: border-box; position: relative; overflow: hidden; }

.toolkit-section { background: #ffffff; padding: 100px 20px; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }
.toolkit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; max-width: 1000px; margin: 60px auto 0; }
.toolkit-card { background: #f8fafc; padding: 35px; border-radius: 12px; border: 1px solid #e2e8f0; transition: 0.3s; }
.toolkit-card:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.05); background: #ffffff; }
.toolkit-icon { font-size: 1.8rem; margin-bottom: 15px; display: inline-block; background: #eff6ff; width: 50px; height: 50px; line-height: 50px; text-align: center; border-radius: 10px; border: 1px solid #bfdbfe; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; max-width: 1200px; margin: 60px auto 40px; padding: 0 20px; }
.pricing-card { background: white; padding: 40px 30px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 10px 25px rgba(0,0,0,0.02); transition: 0.3s; display: flex; flex-direction: column; }
.pricing-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); border-color: #cbd5e1; }
.pricing-card.popular { border: 2px solid #3b82f6; position: relative; }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #3b82f6; color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }

.tier-name { font-size: 1.3rem; font-weight: 800; color: #0f172a; margin: 0 0 10px 0; }
.tier-price { font-size: 3rem; font-weight: 800; color: #0f172a; margin-bottom: 5px; line-height: 1; letter-spacing: -0.04em; }
.tier-sub { font-size: 0.95rem; color: #64748b; margin-bottom: 30px; }

.features-list { list-style: none; padding: 0; margin: 0 0 30px 0; flex: 1; text-align: left; }
.features-list li { margin-bottom: 15px; color: #475569; display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; line-height: 1.4; }
.check { color: #10b981; font-weight: bold; font-size: 1.1rem; }

.btn-tier { width: 100%; text-align: center; background: #f1f5f9; color: #3b82f6; padding: 14px; border-radius: 8px; font-weight: 700; text-decoration: none; border: 1px solid #cbd5e1; transition: 0.2s; box-sizing: border-box; display: inline-block; }
.btn-tier:hover { background: #e2e8f0; }
.btn-tier.active { background: #3b82f6; color: white; border-color: #3b82f6; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.btn-tier.active:hover { background: #2563eb; }

@media (max-width: 1000px) {
    .floating-pill { display: none; }
    .zig-zag-row, .zig-zag-row.reverse { flex-direction: column; text-align: center; gap: 40px; }
    .hero-headline { font-size: 3.5rem; }
    .toolkit-grid { grid-template-columns: 1fr; }
}
