/* ==========================================================================
   StartAi.PropertyNetwork - Modern SaaS Responsive UI (Phase 2 MLS Network)
   Updated: 2026-11-10
   ========================================================================== */

/* Base Container */
.property-network-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    margin: 20px 0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.property-network-wrapper * {
    box-sizing: border-box;
}

/* Header & Title Block */
.pn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.pn-title-group {
    flex: 1 1 320px;
}

.pn-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.pn-title-group h2 {
    margin: 4px 0 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.pn-subtitle {
    margin: 6px 0 0 0;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.4;
}

.pn-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tabs: Segmented Control */
.pn-tabs-nav {
    display: flex !important;
    gap: 8px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 6px !important;
    margin-bottom: 24px !important;
    flex-wrap: wrap !important;
}

.pn-tab-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 18px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    user-select: none !important;
}

.pn-tab-btn:hover {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.6) !important;
}

.pn-tab-btn.active {
    background: #ffffff !important;
    color: #1d4ed8 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
    font-weight: 700 !important;
}

/* Tab Panes */
.pn-tab-content > .pn-tab-pane {
    display: none;
}

.pn-tab-content > .pn-tab-pane.active {
    display: block;
    animation: pnFadeIn 0.25s ease-in-out;
}

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

/* Pane Header */
.pn-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.pn-pane-header h3 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: #0f172a;
}

/* Grid Cards (Networks) */
.pn-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.pn-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pn-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.pn-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.pn-card-code {
    font-size: 0.78rem;
    color: #2563eb;
    background: #eff6ff;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 10px;
    align-self: flex-start;
}

.pn-card-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.45;
    margin-bottom: 16px;
}

/* Empty State */
.pn-empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    margin: 10px 0;
}

.pn-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}

.pn-empty-state h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.pn-empty-state p {
    color: #64748b;
    font-size: 0.88rem;
    max-width: 500px;
    margin: 0 auto 20px auto;
    line-height: 1.5;
}

.pn-loading {
    padding: 30px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Filter Bar */
.pn-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pn-filter-bar .form-control {
    min-width: 260px;
}

/* Data Tables */
.pn-table-responsive {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    text-align: left;
    margin-bottom: 0;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.table-hover tbody tr:hover td {
    background-color: #f8fafc;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.3;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-secondary {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.btn-info {
    background: #0284c7;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-xs {
    padding: 4px 9px;
    font-size: 0.75rem;
    border-radius: 5px;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 9px 13px;
    font-size: 0.88rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

/* Modals */
.pn-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.pn-modal-dialog {
    margin: 40px auto;
    max-width: 580px;
    width: 100%;
}

.pn-modal-content {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    animation: pnModalSlide 0.25s ease-out;
}

@keyframes pnModalSlide {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pn-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.pn-modal-header h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.pn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 6px;
}

.pn-close-modal:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.pn-modal-body {
    padding: 24px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.pn-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.pn-form-group {
    margin-bottom: 14px;
}

.pn-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

/* Utilities */
.text-center { text-align: center; }
.text-danger { color: #dc2626; }
.text-muted { color: #64748b; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.small { font-size: 0.8rem; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .property-network-wrapper {
        padding: 16px;
    }

    .pn-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pn-actions {
        width: 100%;
    }

    .pn-actions .btn {
        width: 100%;
    }

    .pn-tabs-nav {
        flex-direction: column;
    }

    .pn-tab-btn {
        width: 100%;
    }

    .pn-filter-bar {
        width: 100%;
        flex-direction: column;
    }

    .pn-filter-bar .form-control {
        width: 100%;
        min-width: 0;
    }

    .pn-filter-bar .btn {
        width: 100%;
    }
}
