/* submissions.css — styles specific to the submissions feed and detail modal */

/* ── Placeholders ───────────────────────────────────────────────────── */
::placeholder {
    color: #c8cdd5;
    opacity: 1;
}

/* ── Page layout ─────────────────────────────────────────────── */
.submissions-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 24px 0;
    height: calc(100dvh - 44px);   /* full height below fixed top-nav */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.submissions-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.submissions-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* ── Submissions header (title + refresh button row) ─────────── */
.submissions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.submissions-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
}

.submissions-refresh-btn {
    background: white;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: #2c3e50;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.submissions-refresh-btn:hover {
    background: #f0f4f8;
    border-color: #3498db;
    color: #3498db;
}

.submissions-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Feed container ──────────────────────────────────────────── */
.submissions-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 24px;
}

/* ── Load More button ────────────────────────────────────────── */
.sub-load-more-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 8px auto 0;
    padding: 10px 28px;
    background: #f4f6f8;
    border: 0px solid #dde2e8;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}
.sub-load-more-btn:hover {
    background: #e8ecf0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.sub-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.sub-load-more-icon {
    font-size: 18px;
    line-height: 1;
    color: #7f8c8d;
}
.sub-load-more-label {
    font-size: 11px;
    color: #95a5a6;
    font-weight: 500;
}

/* ── Spam card dimming ───────────────────────────────────────── */
.submission-card--spam {
    opacity: 0.55;
    border-left: 3px solid #e74c3c;
}
/* ── Days note footer ────────────────────────────────────────────────── */
.sub-days-note {
    text-align: center;
    font-size: 11px;
    color: #b0b8c1;
    padding: 10px 0 4px;
    flex-shrink: 0;
}
.sub-loading, .sub-empty, .sub-error {
    color: #95a5a6;
    font-size: 12px;
    padding: 12px 0;
}

.sub-error { color: #e74c3c; }

/* ── Submission card ─────────────────────────────────────────── */
.submission-card {
    background: white;
    border-radius: 6px;
    border: 1px solid #e8ecf0;
    padding: 8px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.submission-card:hover {
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(52,152,219,0.15);
}

/* Top row: name/service/dot on left, status label + date on right */
.sub-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.sub-card-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.sub-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Bottom row: details snippet + follow-up/notes */
.sub-card-bottom {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 14px; /* align under name, past status dot */
}

.sub-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-name {
    font-weight: 700;
    font-size: 12px;
    color: #2c3e50;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-service-chip {
    background: #eaf4fd;
    color: #2980b9;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-bot-chip {
    font-size: 11px;
    flex-shrink: 0;
}

.sub-status-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-details-inline {
    font-size: 11px;
    color: #888;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sub-followup-row {
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-followup-row.overdue {
    color: #e74c3c;
    font-weight: 600;
}

.sub-notes-row {
    font-size: 10px;
    color: #6b7280;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 260px;
}

.sub-date {
    font-size: 10px;
    color: #aab;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Submission detail modal ─────────────────────────────────── */
.sub-detail-modal-content {
    max-width: 500px;
    width: 90%;
}

.sub-detail-title-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sub-detail-title-block h2 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.sub-detail-chips {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.sub-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.sub-detail-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.sub-detail-label {
    font-size: 11px;
    font-weight: 700;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: 68px;
    flex-shrink: 0;
}

.sub-detail-value {
    font-size: 13px;
    color: #2c3e50;
    word-break: break-word;
}

.sub-detail-message {
    margin-top: 4px;
}

.sub-detail-message .sub-detail-label {
    display: block;
    margin-bottom: 8px;
    width: auto;
}

.sub-detail-message p {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
}

/* ── Stats bar ───────────────────────────────────────────────────── */
.sub-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    flex-shrink: 0;
    min-height: 0;
}

.sub-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: color-mix(in srgb, var(--stat-color) 12%, white);
    color: var(--stat-color);
    border: 1.5px solid color-mix(in srgb, var(--stat-color) 30%, transparent);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.sub-stat-pill strong {
    font-weight: 800;
}

/* ── Status dot on feed card ─────────────────────────────────────── */
.sub-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Follow-up overdue badge ─────────────────────────────────────── */
.followup-badge {
    font-size: 12px;
    flex-shrink: 0;
}

/* ── Modal editable section ──────────────────────────────────────── */
.sub-detail-editable {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
}

.sub-detail-row--col {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.sub-detail-row--col .sub-detail-label {
    width: auto;
}

.sub-detail-select,
.sub-detail-date-input {
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    color: #2c3e50;
    background: white;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 6px 10px;
    outline: none;
    transition: border-color 0.15s;
}

.sub-detail-date-input {
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    color: #2c3e50;
    background: white;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 6px 10px;
    outline: none;
    transition: border-color 0.15s;
}

.sub-detail-date-input:focus {
    border-color: #3498db;
}

/* ── Status pipeline (chevron bar) ─────────────────────────── */
.sub-status-pipeline {
    display: flex;
    align-items: stretch;
    gap: 3px;
    margin-top: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* hide scrollbar but keep it functional */
    scrollbar-width: none;
    padding-bottom: 2px; /* keep drop-shadow visible */
}

.sub-status-pipeline::-webkit-scrollbar {
    display: none;
}

/* Shell: chevron clip-path + colored background (acts as the border) */
.pipeline-shell {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
    transition: filter 0.15s, transform 0.1s;
}
.pipeline-shell:first-child {
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}
.pipeline-shell:hover {
    transform: translateY(-1px);
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
    z-index: 2;
}

/* Shell border colors */
.pipeline-shell--new       { background: #3498db; }
.pipeline-shell--contacted { background: #f39c12; }
.pipeline-shell--quoted    { background: #e67e22; }
.pipeline-shell--won       { background: #27ae60; }
.pipeline-shell--lost      { background: #95a5a6; }

/*
 * Button: has its OWN chevron clip-path (notch 8.5px instead of 10px)
 * + margin: 1.5px so the shell's colored bg shows as a ~1.5px border
 * on all sides including the diagonal chevron edges.
 */
.pipeline-step {
    display: block;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    outline: none;
    margin: 1.5px;
    padding: 6.5px 22.5px 6.5px 16.5px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    clip-path: polygon(0 0, calc(100% - 8.5px) 0, 100% 50%, calc(100% - 8.5px) 100%, 0 100%, 8.5px 50%);
    transition: background 0.15s, color 0.15s;
    box-shadow: none;
    text-shadow: none;
}
.pipeline-shell:first-child .pipeline-step {
    clip-path: polygon(0 0, calc(100% - 8.5px) 0, 100% 50%, calc(100% - 8.5px) 100%, 0 100%);
    padding-left: 12.5px;
}

/* Active: button fills with the same color as the shell → solid chevron */
.pipeline-shell--new       .pipeline-step.active { background: #3498db !important; color: white !important; }
.pipeline-shell--contacted .pipeline-step.active { background: #f39c12 !important; color: white !important; }
.pipeline-shell--quoted    .pipeline-step.active { background: #e67e22 !important; color: white !important; }
.pipeline-shell--won       .pipeline-step.active { background: #27ae60 !important; color: white !important; }
.pipeline-shell--lost      .pipeline-step.active { background: #95a5a6 !important; color: white !important; }

/* ── Spam checkbox row ────────────────────────────────────── */
.sub-spam-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px dashed #e8ecf0;
    margin-top: 4px;
}

.sub-spam-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #e74c3c;
    flex-shrink: 0;
}

.sub-spam-label {
    font-size: 12px;
    color: #e74c3c;
    cursor: pointer;
    user-select: none;
}

.sub-detail-textarea {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    color: #2c3e50;
    background: white;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 8px 10px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.sub-detail-textarea:focus {
    border-color: #3498db;
}

/* ── Modal footer two-button layout ─────────────────────────────── */
.sub-detail-modal-content .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-secondary {
    background: white;
    color: #555;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background: #f0f4f8;
    border-color: #aab;
}

@media (max-width: 700px) {
    .pipeline-step {
        font-size: 10px;
        padding: 5.5px 16px 5.5px 10px;
    }

    .pipeline-shell:first-child .pipeline-step {
        padding-left: 8px;
    }

    .sub-detail-modal-content {
        width: 96% !important;
    }
}
