/* ====================================================================
   Visual Capture Component — Mobile-first lead capture
   ==================================================================== */

.capture-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100%;
}

/* Header + Tabs */
.capture-header {
    margin-bottom: 1.5rem;
}

.capture-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.capture-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin: 0;
}

.capture-stat-badge {
    background: var(--primary-purple, #8B7EC8);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.capture-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-light, #e5e7eb);
    padding-bottom: 0;
}

.capture-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.capture-tab:hover {
    color: var(--primary-purple, #8B7EC8);
}

.capture-tab.active {
    color: var(--primary-purple, #8B7EC8);
    border-bottom-color: var(--primary-purple, #8B7EC8);
}

/* Capture Form */
.capture-prompt {
    margin-bottom: 1rem;
}

.capture-prompt-text {
    color: var(--text-secondary, #6b7280);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.capture-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.capture-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.capture-textarea:focus {
    outline: none;
    border-color: var(--primary-purple, #8B7EC8);
}

.capture-textarea:disabled {
    opacity: 0.6;
}

.capture-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .capture-form-row {
        grid-template-columns: 1fr;
    }
}

.capture-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.capture-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
}

.capture-select,
.capture-input {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-light, #e5e7eb);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #1a1a2e);
}

.capture-select:focus,
.capture-input:focus {
    outline: none;
    border-color: var(--primary-purple, #8B7EC8);
}

.capture-submit-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-purple, #8B7EC8), var(--primary-green, #7FB069));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.capture-submit-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.capture-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* List View */
.capture-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.capture-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.capture-list-row:hover {
    border-color: var(--primary-purple, #8B7EC8);
    box-shadow: 0 2px 8px rgba(139, 126, 200, 0.1);
}

.capture-list-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.capture-list-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.capture-list-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.capture-list-name {
    font-size: 0.9rem;
    color: var(--text-primary, #1a1a2e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.capture-list-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
}

.capture-list-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.capture-status-new { background: #dbeafe; color: #1e40af; }
.capture-status-contacted { background: #fef3c7; color: #92400e; }
.capture-status-qualified { background: #d1fae5; color: #065f46; }
.capture-status-converted { background: #c7d2fe; color: #3730a3; }
.capture-status-lost { background: #fee2e2; color: #991b1b; }

/* Empty State */
.capture-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.capture-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.capture-empty h3 {
    color: var(--text-primary, #1a1a2e);
    margin: 0 0 0.5rem;
}

.capture-empty p {
    color: var(--text-secondary, #6b7280);
    margin: 0 0 1.5rem;
}

.capture-cta-btn {
    padding: 0.6rem 1.25rem;
    background: var(--primary-purple, #8B7EC8);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

/* Detail View */
.capture-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.capture-back-btn {
    align-self: flex-start;
    padding: 0.4rem 0.75rem;
    background: none;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
}

.capture-back-btn:hover {
    border-color: var(--primary-purple, #8B7EC8);
    color: var(--primary-purple, #8B7EC8);
}

.capture-detail-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 10px;
    padding: 1.25rem;
}

.capture-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.capture-detail-icon {
    font-size: 2rem;
}

.capture-detail-name {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary, #1a1a2e);
}

.capture-detail-type {
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
}

.capture-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.capture-field-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-light, #f3f4f6);
}

.capture-field-row:last-child {
    border-bottom: none;
}

.field-label {
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    min-width: 80px;
    flex-shrink: 0;
}

.capture-field-row a {
    color: var(--primary-purple, #8B7EC8);
    text-decoration: none;
}

.capture-field-row a:hover {
    text-decoration: underline;
}

/* Enrich Button */
.capture-enrich-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-surface, #fff);
    border: 1.5px solid var(--primary-green, #7FB069);
    border-radius: 6px;
    color: var(--primary-green, #7FB069);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
}

.capture-enrich-btn:hover:not(:disabled) {
    background: rgba(127, 176, 105, 0.08);
}

.capture-enrich-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Enrichment Card */
.capture-enrichment {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

.capture-enrichment h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-green, #7FB069);
    margin: 0 0 0.5rem;
}

.capture-link {
    color: var(--primary-purple, #8B7EC8) !important;
    font-weight: 500;
}

/* Recommendations */
.capture-recs-card {
    background: linear-gradient(135deg, rgba(139, 126, 200, 0.05), rgba(127, 176, 105, 0.05));
    border: 1px solid rgba(139, 126, 200, 0.2);
    border-radius: 10px;
    padding: 1.25rem;
}

.capture-recs-card h4 {
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
    color: var(--text-primary, #1a1a2e);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.capture-priority {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.capture-priority-high { background: #fee2e2; color: #991b1b; }
.capture-priority-medium { background: #fef3c7; color: #92400e; }
.capture-priority-low { background: #dbeafe; color: #1e40af; }

.capture-recs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.capture-rec-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary, #1a1a2e);
}

.capture-rec-type {
    flex-shrink: 0;
}

/* Spinner */
.capture-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: capture-spin 0.6s linear infinite;
}

.capture-loading .capture-spinner {
    border-color: rgba(139, 126, 200, 0.2);
    border-top-color: var(--primary-purple, #8B7EC8);
}

@keyframes capture-spin {
    to { transform: rotate(360deg); }
}

.capture-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--text-secondary, #6b7280);
    font-size: 0.9rem;
}

/* Mode Toggle (text / photo) */
.capture-mode-toggle {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: var(--border-light, #f3f4f6);
    border-radius: 8px;
    padding: 3px;
}

.capture-mode-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.capture-mode-btn.active {
    background: var(--bg-surface, #fff);
    color: var(--primary-purple, #8B7EC8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Photo Upload Zone */
.capture-photo-zone {
    border: 2px dashed var(--border-light, #d1d5db);
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.capture-photo-zone:hover,
.capture-drag-over {
    border-color: var(--primary-purple, #8B7EC8);
    background: rgba(139, 126, 200, 0.04);
}

.capture-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.capture-photo-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.capture-photo-icon {
    font-size: 2.5rem;
}

.capture-photo-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a2e);
}

.capture-photo-hint {
    font-size: 0.75rem;
    color: var(--text-secondary, #9ca3af);
}

/* Photo Preview */
.capture-photo-preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--border-light, #f3f4f6);
}

.capture-preview-img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.capture-photo-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.capture-photo-name {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    background: var(--bg-surface, #fff);
}

/* Detail View Photo */
.capture-detail-photo {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: var(--border-light, #f3f4f6);
}

.capture-detail-img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

/* List Thumbnail */
.capture-list-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* URL Input */
.capture-url-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.capture-url-input:focus {
    outline: none;
    border-color: var(--primary-purple, #8B7EC8);
}

/* Batch Review */
.capture-batch-header h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    color: var(--text-primary, #1a1a2e);
}

.capture-batch-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.capture-batch-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1.5px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.capture-batch-item:hover {
    border-color: var(--primary-purple, #8B7EC8);
}

.capture-batch-item.selected {
    border-color: var(--primary-purple, #8B7EC8);
    background: rgba(139, 126, 200, 0.04);
}

.capture-batch-item input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--primary-purple, #8B7EC8);
}

.capture-batch-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.capture-batch-info strong {
    font-size: 0.9rem;
    color: var(--text-primary, #1a1a2e);
}

.capture-batch-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    margin-top: 2px;
}

.capture-batch-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.capture-batch-actions .capture-back-btn {
    flex-shrink: 0;
}

/* Streak Bar (header) */
.capture-streak-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.capture-streak-fire {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.capture-week-badge {
    font-size: 0.7rem;
    color: var(--primary-green, #7FB069);
    font-weight: 500;
}

.capture-milestone-hint {
    font-size: 0.7rem;
    color: var(--text-secondary, #9ca3af);
}

/* Insights View */
.capture-insights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.capture-insights-summary {
    background: linear-gradient(135deg, rgba(139, 126, 200, 0.06), rgba(127, 176, 105, 0.06));
    border: 1px solid rgba(139, 126, 200, 0.15);
    border-radius: 10px;
    padding: 1rem;
}

.capture-insights-summary p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary, #1a1a2e);
}

.capture-insights-section {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    padding: 1rem;
}

.capture-insights-section h4 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-purple, #8B7EC8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.capture-insights-section ul {
    margin: 0;
    padding: 0 0 0 1.2rem;
}

.capture-insights-section li {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 0.25rem;
}

/* Streaks Section */
.capture-streaks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.capture-streak-card {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--border-light, #f9fafb);
    border-radius: 8px;
}

.streak-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-purple, #8B7EC8);
}

.streak-label {
    font-size: 0.65rem;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.capture-milestones {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.capture-milestone-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-purple, #8B7EC8), var(--primary-green, #7FB069));
    color: #fff;
    cursor: help;
}

@media (max-width: 480px) {
    .capture-streaks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile tweaks */
@media (max-width: 640px) {
    .capture-container {
        padding: 0.75rem;
    }

    .capture-title {
        font-size: 1.25rem;
    }

    .capture-textarea {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    .capture-photo-zone {
        padding: 1.5rem 0.75rem;
    }
}
