/* StayDNA Styles - Welcome In kleurstelling */
:root {
    --wi-primary: #ef4444;
    --wi-primary-dark: #dc2626;
    --wi-primary-darker: #b91c1c;
    --wi-primary-light: #fef2f2;
    --wi-primary-50: #fef2f2;
    --wi-primary-100: #fee2e2;
    --wi-primary-200: #fecaca;
    --wi-bg: #f9fafb;
    --wi-text: #111827;
    --wi-text-muted: #6b7280;
    --sidebar-width: 16rem;
}

body {
    background-color: var(--wi-bg);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--wi-text);
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

/* ============================
   Sidebar
   ============================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #f87171, var(--wi-primary-dark));
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.sidebar-subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background-color: rgba(255, 255, 255, 0.15);
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-link.active .sidebar-icon {
    background-color: rgba(255, 255, 255, 0.25);
}

/* User section at bottom of sidebar */
.sidebar-user {
    padding: 0.75rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: auto;
}

.sidebar-user-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.sidebar-logout:hover {
    color: #fff;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1050;
    background: var(--wi-primary-dark);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

/* ============================
   Main content area
   ============================ */
.main-content {
    padding-left: var(--sidebar-width);
    min-height: 100vh;
}

.main-content > .alert,
.main-content > div {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.main-content {
    padding: 1.5rem 1.5rem 1.5rem calc(var(--sidebar-width) + 1.5rem);
}

/* ============================
   Responsive: Mobile
   ============================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar.show + .sidebar-toggle + .main-content + .sidebar-overlay,
    .sidebar.show ~ .sidebar-overlay {
        display: block;
    }
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 3.5rem;
    }
}

/* ============================
   Override Bootstrap primary color
   ============================ */
.btn-primary {
    background-color: var(--wi-primary) !important;
    border-color: var(--wi-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--wi-primary-dark) !important;
    border-color: var(--wi-primary-dark) !important;
}

.btn-primary:active {
    background-color: var(--wi-primary-darker) !important;
    border-color: var(--wi-primary-darker) !important;
}

.btn-outline-primary {
    color: var(--wi-primary) !important;
    border-color: var(--wi-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--wi-primary) !important;
    border-color: var(--wi-primary) !important;
    color: #fff !important;
}

/* Links */
a {
    color: var(--wi-primary-dark);
}

a:hover {
    color: var(--wi-primary-darker);
}

/* Form focus states */
.form-control:focus,
.form-select:focus {
    border-color: var(--wi-primary);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.form-check-input:checked {
    background-color: var(--wi-primary);
    border-color: var(--wi-primary);
}

/* ============================
   Page header
   ============================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--wi-text);
}

/* ============================
   Tab navigation for property form
   ============================ */
.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.section-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: #495057;
    background: #f8f9fa;
    border: 1px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
    white-space: nowrap;
}

.section-tab:hover {
    background: var(--wi-primary-100);
    color: var(--wi-primary-dark);
}

.section-tab.active {
    background: var(--wi-primary);
    color: #fff;
    border-color: var(--wi-primary);
}

/* Section form */
.section-form-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.section-form-card.compact {
    padding: 1.25rem;
}

.section-form-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--wi-primary);
}

/* Compact edit field rows */
.edit-field {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.edit-field:last-of-type {
    border-bottom: none;
}

.edit-field-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.edit-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--wi-text);
    margin: 0;
}

.edit-field-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.edit-field .form-control,
.edit-field .form-select {
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
}

.edit-field .form-control:not(textarea) {
    height: 2rem;
}

.edit-field textarea.form-control {
    min-height: 2.5rem;
}

.edit-field .form-text {
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.edit-field .form-check-input {
    margin-top: 0.15rem;
}

/* ============================
   Property list
   ============================ */
.property-card {
    transition: box-shadow 0.15s;
}

.property-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}

/* Completeness indicator */
.completeness-bar {
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    overflow: hidden;
}

.completeness-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
    background-color: var(--wi-primary);
}

/* ============================
   HTMX loading indicator
   ============================ */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* ============================
   Filter bar
   ============================ */
.filter-bar {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.875rem;
}

/* ============================
   Cards
   ============================ */
.card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Badges / pills */
.badge.bg-primary {
    background-color: var(--wi-primary) !important;
}

/* ============================
   Pagination
   ============================ */
.page-link {
    color: var(--wi-primary-dark);
}

.page-item.active .page-link {
    background-color: var(--wi-primary);
    border-color: var(--wi-primary);
}

/* ============================
   Tables
   ============================ */
.table > thead {
    background-color: var(--wi-primary-50);
}

.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* ============================
   Property detail - Section navigation
   ============================ */
.detail-nav {
    position: sticky;
    top: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.detail-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--wi-text);
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s;
}

.detail-nav-item:last-child {
    border-bottom: none;
}

.detail-nav-item:hover {
    background-color: #f9fafb;
    color: var(--wi-text);
}

.detail-nav-item.active {
    background-color: var(--wi-primary-50);
    border-left: 3px solid var(--wi-primary);
}

.detail-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    background: var(--wi-primary-50);
    color: var(--wi-primary-dark);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.detail-nav-text {
    flex: 1;
    min-width: 0;
}

.detail-nav-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-nav-progress {
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 0.25rem;
    overflow: hidden;
}

.detail-nav-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: #d1d5db;
    transition: width 0.3s;
}

.detail-nav-progress-fill.fill-warning {
    background: #f59e0b;
}

.detail-nav-progress-fill.fill-success {
    background: #10b981;
}

.detail-nav-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 1rem;
    flex-shrink: 0;
    color: #6b7280;
    background: #f3f4f6;
}

.detail-nav-badge.badge-success {
    color: #065f46;
    background: #d1fae5;
}

.detail-nav-badge.badge-warning {
    color: #92400e;
    background: #fef3c7;
}

.detail-nav-badge.badge-muted {
    color: #6b7280;
    background: #f3f4f6;
}

/* ============================
   Property detail - Section cards
   ============================ */
.detail-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    background: linear-gradient(to right, #fefefe, #fafafa);
}

.detail-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: var(--wi-primary-50);
    color: var(--wi-primary-dark);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.detail-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--wi-text);
}

.detail-section-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.detail-section-progress {
    width: 60px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.detail-section-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: #d1d5db;
    transition: width 0.3s;
}

.detail-section-progress-fill.fill-warning {
    background: #f59e0b;
}

.detail-section-progress-fill.fill-success {
    background: #10b981;
}

.detail-section-pct {
    font-size: 0.7rem;
    color: var(--wi-text-muted);
}

.detail-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--wi-primary-dark);
    background: var(--wi-primary-50);
    border: 1px solid var(--wi-primary-200);
    transition: all 0.15s;
    white-space: nowrap;
}

.detail-edit-btn:hover {
    background: var(--wi-primary);
    color: #fff;
    border-color: var(--wi-primary);
}

/* Section body and fields */
.detail-section-body {
    padding: 0;
}

.detail-field {
    display: flex;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid #f9fafb;
    font-size: 0.875rem;
    transition: background-color 0.1s;
}

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

.detail-field:hover {
    background-color: #fafbfc;
}

.detail-field.even {
    background-color: #fafbfc;
}

.detail-field.even:hover {
    background-color: #f5f6f7;
}

.detail-field-label {
    width: 40%;
    flex-shrink: 0;
    font-weight: 500;
    color: var(--wi-text-muted);
    padding-right: 1rem;
}

.detail-field-value {
    flex: 1;
    color: var(--wi-text);
    word-break: break-word;
}

/* Boolean field styling */
.field-bool {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
}

.field-bool-yes {
    color: #065f46;
    background: #d1fae5;
}

.field-bool-no {
    color: #6b7280;
    background: #f3f4f6;
}

/* URL field styling */
.field-link {
    font-size: 0.825rem;
    color: var(--wi-primary-dark);
    text-decoration: none;
}

.field-link:hover {
    color: var(--wi-primary-darker);
    text-decoration: underline;
}

.field-link .bi {
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Empty section state */
.detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--wi-text-muted);
    font-size: 0.875rem;
}

.detail-empty .bi {
    font-size: 1.25rem;
    opacity: 0.4;
}

.detail-empty-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--wi-primary-dark);
    text-decoration: none;
    padding: 0.2rem 0.6rem;
    background: var(--wi-primary-50);
    border-radius: 0.25rem;
}

.detail-empty-link:hover {
    background: var(--wi-primary-100);
}

/* ============================
   Visibility badges (intern/extern)
   ============================ */
.vis-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    vertical-align: middle;
    margin-left: 0.4rem;
    user-select: none;
}

.vis-badge .bi {
    font-size: 0.6rem;
}

.vis-extern {
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
}

.vis-extern:hover {
    background: #a7f3d0;
}

.vis-intern {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.vis-intern:hover {
    background: #fde68a;
}

/* ============================
   Missing information overview
   ============================ */
.missing-overview {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.missing-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
}

.missing-overview-header:hover {
    background-color: #fafbfc;
}

.missing-overview-ring {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
}

.missing-overview-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.missing-overview-ring .ring-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 3;
}

.missing-overview-ring .ring-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.ring-fill.ring-success { stroke: #10b981; }
.ring-fill.ring-warning { stroke: #f59e0b; }
.ring-fill.ring-danger { stroke: var(--wi-primary); }

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--wi-text);
}

.missing-overview-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--wi-text);
}

.missing-overview-meta {
    font-size: 0.8rem;
    color: var(--wi-text-muted);
    margin: 0.1rem 0 0;
}

.missing-toggle {
    color: var(--wi-text-muted);
    transition: transform 0.2s;
}

.missing-detail.show + .missing-overview-header .missing-toggle,
.missing-overview-header:has(+ .missing-detail.show) .missing-toggle {
    transform: rotate(180deg);
}

.missing-detail {
    display: none;
    border-top: 1px solid #f3f4f6;
}

.missing-detail.show {
    display: block;
}

.missing-section {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f9fafb;
}

.missing-section:last-child {
    border-bottom: none;
}

.missing-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.missing-section-icon {
    color: var(--wi-primary-dark);
    font-size: 0.85rem;
}

.missing-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wi-text);
}

.missing-section-count {
    font-size: 0.7rem;
    color: #fff;
    background: var(--wi-primary);
    padding: 0.1rem 0.45rem;
    border-radius: 1rem;
    font-weight: 600;
}

.missing-section-link {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--wi-primary-dark);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--wi-primary-50);
    border: 1px solid var(--wi-primary-200);
    transition: all 0.15s;
    white-space: nowrap;
}

.missing-section-link:hover {
    background: var(--wi-primary);
    color: #fff;
    border-color: var(--wi-primary);
}

.missing-section-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.missing-field-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--wi-text-muted);
    background: #f3f4f6;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #e5e7eb;
    transition: all 0.15s;
}

.missing-field-tag.verified {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
    text-decoration: line-through;
    text-decoration-color: #6ee7b7;
}

.verify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s;
    flex-shrink: 0;
}

.verify-btn:hover {
    color: #065f46;
    background: #d1fae5;
}

.verify-btn.verified {
    color: #065f46;
}

.verify-btn.verified:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* Verified empty field in section detail */
.detail-field.verified-empty {
    opacity: 0.6;
}

.field-verified-empty {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6ee7b7;
    font-style: italic;
}

/* Verify badge in edit form */
.verify-form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    font-size: 0.6rem;
    border-radius: 50%;
    cursor: pointer;
    color: #d1d5db;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: all 0.15s;
    user-select: none;
    flex-shrink: 0;
}

.verify-form-badge:hover {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.verify-form-badge.verified {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.verify-form-badge.verified:hover {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

/* Smaller vis-badge inside edit form */
.edit-field-badges .vis-badge {
    font-size: 0.6rem;
    padding: 0.05rem 0.35rem;
}

.edit-field.is-verified-empty .form-control,
.edit-field.is-verified-empty .form-select {
    opacity: 0.45;
    background-color: #f9fafb;
}

/* ============================
   Login page (standalone, not in sidebar layout)
   ============================ */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #f87171, #dc2626);
    display: flex;
    align-items: center;
    justify-content: center;
}
