/* PropInspect - Inspection Flow Styles */

/* ========================================
   INSPECTION PROGRESS
   ======================================== */

.inspection-progress {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    z-index: var(--z-sticky);
}

.progress-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

.selected-property-display {
    display: none;
}

.progress-text {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-align: center;
    margin-top: var(--space-1);
}

.pt-header-progress {
    padding-top: calc(60px + 40px);
}

/* ========================================
   INSPECTION SECTIONS
   ======================================== */

.inspection-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: var(--space-4);
    overflow: hidden;
}

.section-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-hover);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.section-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.section-questions {
    padding: var(--space-4);
}

/* ========================================
   SECTION PHOTOS
   ======================================== */

.section-photos {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
}

.section-photos-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.section-photo-count {
    font-size: var(--text-xs);
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.section-photo-count:empty {
    display: none;
}

.section-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.section-photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.section-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.section-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.section-photo-thumb:hover .section-photo-remove,
.section-photo-thumb:active .section-photo-remove {
    opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
    .section-photo-remove {
        opacity: 1;
    }
}

.section-photo-actions {
    display: flex;
    gap: var(--space-2);
}

.section-photo-actions .btn {
    flex: 1;
    min-width: 0;
}

.section-photo-actions .btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========================================
   QUESTION FIELDS
   ======================================== */

.question-field {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.question-field:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.question-label {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
}

.required-mark {
    color: var(--color-error);
    margin-left: 4px;
}

.question-help {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.question-extras {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.question-extras .btn.active {
    color: var(--color-primary);
}

.question-photos {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--color-surface-hover);
    border-radius: var(--radius-md);
}

.question-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.question-photo-grid:empty {
    display: none;
}

.question-photo-actions {
    display: flex;
    gap: var(--space-2);
}

.question-photo-actions .btn {
    flex: 1;
    min-width: 0;
}

.question-photo-badge {
    font-size: var(--text-xs);
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    margin-left: 2px;
}

.question-photo-badge:empty {
    display: none;
}

.question-note {
    margin-top: var(--space-3);
}

/* GPS Capture */
.gps-capture {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.gps-display {
    flex: 1;
    padding: var(--space-3);
    background: var(--color-surface-hover);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

/* Barcode Capture */
.barcode-capture {
    display: flex;
    gap: var(--space-2);
}

.barcode-capture .form-input {
    flex: 1;
}

/* ========================================
   INSPECTION RESPONSES
   (Defined in components.css)
   ======================================== */

/* ========================================
   ISSUE DETAIL
   (Defined in components.css)
   ======================================== */

/* ========================================
   ACTION BUTTONS
   (Defined in components.css)
   ======================================== */

/* ========================================
   PROFILE
   ======================================== */

.profile-header {
    text-align: center;
    padding: var(--space-6) 0;
}

.profile-name {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-top: var(--space-3);
}

.profile-email {
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* ========================================
   SETTINGS
   ======================================== */

.settings-group {
    padding: var(--space-2) 0;
}

.settings-title {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
}

/* ========================================
   AUTH
   ======================================== */

.auth-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-4);
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.auth-header h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

/* ========================================
   WORK ORDER TYPE ICONS
   ======================================== */

.wo-type-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wo-type-icon svg {
    width: 20px;
    height: 20px;
}

.wo-type-icon.routine {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
}

.wo-type-icon.preventive {
    background: rgba(67, 97, 238, 0.15);
    color: var(--color-primary);
}

.wo-type-icon.corrective {
    background: rgba(250, 204, 21, 0.15);
    color: #ca8a04;
}

.wo-type-icon.emergency {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
}

/* ========================================
   ASSET THUMBNAIL
   ======================================== */

.asset-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

/* ========================================
   HEADER ACTIONS
   (Defined in layout.css)
   ======================================== */

/* ========================================
   COMPARE TO MOVE-IN — picker + diff view
   (plan-v6 phase A)
   ======================================== */

.compare-candidate-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.compare-candidate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}
.compare-candidate:hover { background: var(--color-surface-hover); }
.compare-candidate--preselected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary) inset;
}
.compare-candidate__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.compare-candidate__date { font-weight: var(--font-medium); }
.compare-candidate__tenant { font-size: var(--text-sm); color: var(--color-text-muted); }

.diff-summary {
    padding: var(--space-4);
}
.diff-summary__title { font-weight: var(--font-medium); margin-bottom: var(--space-1); }
.diff-summary__dates { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-3); }
.diff-summary__counts { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.diff-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    overflow: hidden;
}
.diff-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-weight: var(--font-medium);
    list-style: none;
}
.diff-section__head::-webkit-details-marker { display: none; }
.diff-section__head::before {
    content: '▸';
    color: var(--color-text-muted);
    transition: transform 0.15s;
}
details[open] > .diff-section__head::before { transform: rotate(90deg); }
.diff-section__title { flex: 1; }
.diff-section__body { border-top: 1px solid var(--color-border); }

.diff-row {
    display: grid;
    grid-template-columns: 1fr 180px 1fr;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    align-items: start;
}
.diff-row:last-child { border-bottom: none; }
.diff-row--header {
    background: var(--color-surface-hover);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: var(--font-medium);
}
.diff-row--unchanged   { background: transparent; }
.diff-row--improved    { background: var(--color-success-muted); }
.diff-row--degraded    { background: var(--color-warning-muted); }
.diff-row--damaged_new { background: var(--color-error-muted); }
.diff-row--changed     { background: var(--color-info-muted); }
.diff-row--one_sided   { background: var(--color-info-muted); }

.diff-row__cell { min-width: 0; word-break: break-word; }
.diff-row__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    text-align: center;
}
.diff-row__question { font-weight: var(--font-medium); font-size: var(--text-sm); }
.diff-row__badge {
    display: inline-flex;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
}
.diff-row__badge--muted   { background: var(--color-surface-hover); color: var(--color-text-muted); }
.diff-row__badge--success { background: var(--color-success-muted); color: var(--color-success); }
.diff-row__badge--warning { background: var(--color-warning-muted); color: var(--color-warning); }
.diff-row__badge--error   { background: var(--color-error-muted); color: var(--color-error); }
.diff-row__badge--info    { background: var(--color-info-muted); color: var(--color-info); }

.diff-pill {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 4px 4px 0;
    background: var(--color-surface-hover);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
}
.diff-note {
    margin-top: var(--space-1);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}
.diff-photo-count {
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    .diff-row {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    .diff-row__item { order: -1; align-items: flex-start; text-align: left; }
    .diff-row__cell--in::before  { content: 'Move-In: ';  font-weight: var(--font-medium); color: var(--color-text-muted); }
    .diff-row__cell--out::before { content: 'Move-Out: '; font-weight: var(--font-medium); color: var(--color-text-muted); }
    .diff-row--header { display: none; }
}
