/* DNA Table Styles */

/* Match Score */
.match-score-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.match-score-text {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text-main);
}

.match-score-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    min-width: 60px;
}

.match-score-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Status Dot */
.status-dot-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.status-dot-text {
    font-size: 0.95em;
}

.grid-table td[data-label="Urgenza"] .dna-badge,
.grid-table td[data-label="URGENZA"] .dna-badge,
.grid-table td[data-label="Urgenza"] .badge-value,
.grid-table td[data-label="URGENZA"] .badge-value {
    margin-right: 6px;
    margin-bottom: 4px;
}

/* Reference Cards (Table Cells) - UNIT-734 Cleanup */
.ref-card-subtitle {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 2px;
}

.ref-card-subtitle i {
    font-size: 0.8em;
    margin-right: 4px;
}

.ref-card-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    cursor: pointer;
    display: flex;
    gap: 3px;
}

.ref-card-icon {
    margin-right: 6px;
}

.ref-card-icon.link {
    color: var(--text-muted);
    margin: 0;
    margin-right: 10px;
}

.ref-card-icon.user {
    color: var(--text-muted);
}

.ref-card-content {
    display: inline-block;
    vertical-align: middle;
}

.ref-card-readonly-container {
    display: inline-block;
}

/* Money Field - UNIT-734 Cleanup */
.dna-money, .grid-table tbody td.dna-money {
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

/* Geo Card */
.geo-card-icon {
    color: var(--primary-color);
    margin-right: 6px;
}

/* Geo Range */
.geo-range-wrapper {
    display: flex;
    flex-direction: column;
    font-size: 0.85em;
    gap: 2px;
}

.geo-range-address {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.geo-range-radius {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.geo-range-radius i {
    color: var(--accent);
}

/* Table Chips (Tags, Multi-select) */
.dna-table-chip {
    font-size: 0.8em;
    padding: 2px 6px;
}

/* Property Specs */
.spec-item-container {
    margin-right: 6px;
    white-space: nowrap;
}

.spec-item-icon {
    color: var(--text-muted);
    font-size: 0.8em;
}

.spec-bool-chip {
    font-size: 0.7em;
    padding: 1px 5px;
    height: auto;
    min-height: 0;
}

@media (max-width: 768px) {
    .management-cell .dna-badge--title {
        flex: 1 1 100%;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Detail View - Geo Map */
.geo-map-container {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
    background: #eee;
}

/* Detail View - Geo Range Card */
.geo-range-detail-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.geo-range-detail-icon {
    font-size: 1.5em;
    color: var(--primary-color);
}

.geo-range-detail-info {
    flex: 1;
}

.geo-range-detail-address {
    font-weight: 500;
    margin-bottom: 4px;
}

.geo-range-detail-meta {
    font-size: 0.9em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.geo-range-badge {
    background: var(--accent);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

/* Checkbox Colors */
.checkbox-yes {
    color: var(--success);
}

.checkbox-no {
    color: var(--text-muted);
}

/* Action Buttons */
.row-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions-header {
    text-align: center;
}

/* =========================================
   Quiz Summary UI Type
   ========================================= */

/* Table Cell - Compact View */
.quiz-summary-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.quiz-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.quiz-summary-badge.quiz-percorso {
    background: var(--accent);
    color: var(--text-secondary);
}

.quiz-summary-badge.quiz-appointment {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
}

.quiz-summary-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75em;
    color: var(--text-muted);
}

.quiz-summary-meta i {
    font-size: 0.9em;
}

/* Modal - Detailed View */
.quiz-summary-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-summary-header {
    font-size: 1.1em;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, black));
    color: var(--text-secondary);
    border-radius: 8px;
}

.quiz-summary-header i {
    margin-right: 8px;
}

.quiz-summary-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.quiz-section-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 0.95em;
}

.quiz-section-title i {
    margin-right: 6px;
    color: var(--accent);
}

.quiz-answers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-answer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.quiz-answer-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9em;
}

.quiz-answer-value {
    font-weight: 600;
    color: var(--text-main);
}

.quiz-summary-meta-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.quiz-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.quiz-meta-item i {
    color: var(--accent);
}

/* Quiz Steps Timeline - Modern visual display */
.quiz-steps-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 8px;
}

.quiz-step-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    position: relative;
}

.quiz-step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 40px;
    bottom: -12px;
    width: 2px;
    background: var(--border-color);
}

.quiz-step-item .step-marker {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, black) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.quiz-step-item .step-number {
    color: white;
    font-weight: 600;
    font-size: 0.85em;
}

.quiz-step-item .step-content {
    flex: 1;
    padding-top: 4px;
}

.quiz-step-item .step-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quiz-step-item .step-label i {
    font-size: 11px;
    opacity: 0.7;
}

.quiz-step-item .step-value {
    color: var(--text-main);
    font-size: 1em;
    line-height: 1.5;
    word-break: break-word;
}

/* Quiz Value Formatters */
.quiz-value-yes {
    color: var(--success-text);
    font-weight: 500;
}

.quiz-value-yes i {
    margin-right: 4px;
}

.quiz-value-no {
    color: var(--text-muted);
}

.quiz-value-person {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--bg-panel);
    color: var(--accent);
    font-weight: 500;
    border: solid 1px var(--border);
}

.quiz-value-property {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-panel);
    border-radius: 16px;
    color: var(--accent);
    font-weight: 500;
    border: solid 1px var(--border);
}

/* Clickable immobile link */
.quiz-value-property.immobile-link {
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-value-property.immobile-link:hover {
    background: var(--accent);
    color: var(--bg-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent);
}

.quiz-value-property.immobile-link .fa-external-link-alt {
    font-size: 10px;
    opacity: 0.6;
    margin-left: 4px;
}

.quiz-value-property.immobile-link:hover .fa-external-link-alt {
    opacity: 1;
}

.quiz-value-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-panel);
    color: var(--accent);
    border-radius: 16px;
    font-weight: 500;
    font-size: 0.9em;
    border: solid 1px var(--border);
}

.quiz-value-money {
    font-weight: 600;
    color: var(--success);
}

.quiz-value-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85em;
    margin: 2px;
}

.quiz-value-info {
    color: var(--text-muted);
    font-style: italic;
}

.quiz-contact-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quiz-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}

.quiz-contact-item i {
    color: var(--accent);
    width: 16px;
}

.quiz-kv-pair {
    display: inline-block;
    margin-right: 12px;
}

.quiz-kv-pair .kv-key {
    color: var(--text-muted);
    font-size: 0.85em;
}

.quiz-kv-pair .kv-value {
    font-weight: 500;
    color: var(--text-main);
}

.quiz-value-skipped {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9em;
}

/* ===========================================
   HOT BADGES â€” Immobili Table
   =========================================== */

.hot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    margin-right: 6px;
    vertical-align: middle;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hot-badge:hover {
    transform: scale(1.15);
}

.hot-badge-active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px var(--accent);
}

.hot-badge.hot-alpha {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    animation: hot-pulse 2s ease-in-out infinite;
}

.hot-badge.hot-beta {
    background: rgba(253, 126, 20, 0.15);
    color: #fd7e14;
}

.hot-badge.hot-gamma {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

@keyframes hot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}

/* Hot row â€” clickable TR with hot data */
.hot-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.hot-row:hover {
    background: color-mix(in srgb, var(--accent) 5%, transparent) !important;
}

.hot-row-active {
    background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
    box-shadow: inset 3px 0 0 var(--accent);
}

.hot-row-active:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
}

/* Expanded detail row */
.hot-detail-row td {
    padding: 0 !important;
    border-top: none !important;
    background: var(--bg-tertiary);
}

.hot-detail-content {
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 2px solid var(--border);
    animation: hotDetailSlide 0.2s ease-out;
    align-items: stretch;
}

@keyframes hotDetailSlide {
    from { opacity: 0; max-height: 0; padding: 0 16px; }
    to { opacity: 1; max-height: 500px; padding: 12px 16px; }
}

/* Detail row highlight on open */
.hot-detail-highlight {
    animation: hotDetailGlow 1s ease-in-out 2;
}

@keyframes hotDetailGlow {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: inset 0 0 20px color-mix(in srgb, var(--accent) 15%, transparent);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hot-badge {
        width: 20px;
        height: 20px;
        font-size: 11px;
        margin-right: 4px;
    }

    .hot-detail-content {
        flex-direction: column;
        padding: 8px 10px;
        gap: 6px;
    }
}

/* ===========================================
   MODULE FILTER BAR â€” Miei/Tutti Toggle
   =========================================== */

.module-filter-bar {
    display: flex;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 8px;
}

.module-filter-toggle {
    display: flex;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2px;
    gap: 2px;
}

.module-filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.module-filter-btn:hover {
    color: var(--text-main);
}

.module-filter-btn.active {
    background: var(--bg-lighter);
    color: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.module-filter-btn i {
    font-size: 11px;
}

.module-filter-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 12px;
}

@media (max-width: 768px) {
    .module-filter-bar {
        padding: 6px 0;
    }
    .module-filter-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

.dna-human-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dna-human-date-primary {
    font-size: 0.95em;
    color: var(--text-main);
    line-height: 1.2;
}

.dna-human-date-secondary {
    font-size: 0.75em;
    color: var(--text-muted);
    line-height: 1.2;
}

/* ===========================================
   LANA PUBLICATION STATUS BADGES â€” Immobili Table
   =========================================== */

/* Column sizing */
.th-lana-pub-badge,
.td-lana-pub-badge {
    width: 18px;
    padding: 0 4px;
    text-align: center;
    vertical-align: middle;
}

.th-lana-pub-select,
.td-lana-pub-select {
    width: 28px;
    padding: 0 6px;
    text-align: center;
    vertical-align: middle;
}

/* Status dot */
.lana-pub-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: help;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.lana-pub-dot--loading       { background: #ccc; }
.lana-pub-dot--not-published  { background: #adb5bd; }
.lana-pub-dot--synced         { background: #28a745; }
.lana-pub-dot--needs-rag      { background: #fd7e14; }

/* Bulk action toolbar â€” sticky bottom like file-multiselect-bar */
.lana-pub-toolbar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-panel, #1a1a2e);
    border: 1px solid var(--accent, #00bcd4);
    border-radius: 12px;
    margin-top: 12px;
    z-index: 10;
    animation: lanaPubSlideUp 0.2s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
}

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

.lana-pub-toolbar-left,
.lana-pub-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lana-pub-count {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent, #00bcd4);
    white-space: nowrap;
}

/* Mobile */
@media (max-width: 600px) {
    .lana-pub-dot {
        width: 12px;
        height: 12px;
    }
    .th-lana-pub-badge,
    .td-lana-pub-badge {
        width: 20px;
        padding: 0 2px;
    }

    /* Fixed bottom sheet â€” always visible when items are selected */
    .lana-pub-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        /* Rounded top corners = bottom sheet feel */
        border-radius: 14px 14px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        margin-top: 0;
        /* Single compact row */
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 14px 16px;
        /* iPhone safe area (notch / home indicator) */
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .lana-pub-toolbar-left,
    .lana-pub-toolbar-right {
        gap: 8px;
        flex-shrink: 0;
    }

    /* Count â€” slightly larger, bold */
    .lana-pub-toolbar .lana-pub-count {
        font-size: 15px;
        font-weight: 700;
    }

    /* Icon-only buttons â€” circular touch targets */
    .lana-pub-toolbar .multiselect-btn span {
        display: none;
    }
    .lana-pub-toolbar .multiselect-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        font-size: 15px;
    }

    /* Delete button â€” red tint */
    .lana-pub-toolbar #lana-pub-delete-btn {
        border-color: #f44336;
        color: #f44336;
    }
    .lana-pub-toolbar #lana-pub-delete-btn:active {
        background: #f44336;
        color: #fff;
    }

    /* Publish button â€” accent tint */
    .lana-pub-toolbar #lana-pub-sync-btn {
        border-color: var(--accent, #00bcd4);
        color: var(--accent, #00bcd4);
    }
    .lana-pub-toolbar #lana-pub-sync-btn:active {
        background: var(--accent, #00bcd4);
        color: #fff;
    }
}
