/**
 * DevInwest Frontend Styles
 */

/* Reset & Base */
.devinwest-units-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1d2327;
    line-height: 1.5;
    margin: 20px 0;
}

.devinwest-units-wrapper * {
    box-sizing: border-box;
}

/* ========================================
   FILTER BAR
   ======================================== */
.di-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.di-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.di-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
}

.di-filter-group select,
.di-filter-group input,
.di-filter-select,
.di-filter-input {
    padding: 8px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    min-width: 130px;
}

.di-filter-group input[type="number"],
.di-filter-input[type="number"] {
    width: 120px;
}

.di-filter-range {
    min-width: auto;
}

.di-filter-range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.di-filter-range-sep {
    color: #646970;
    font-size: 14px;
}

.di-filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* ========================================
   BUTTONS
   ======================================== */
.di-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
}

.di-btn:active {
    transform: scale(0.98);
}

.di-btn-primary {
    background: #2271b1;
    color: #fff;
}

.di-btn-primary:hover {
    background: #135e96;
    color: #fff;
}

.di-btn-secondary {
    background: #f0f0f1;
    color: #1d2327;
}

.di-btn-secondary:hover {
    background: #ddd;
}

.di-btn-success {
    background: #22c55e;
    color: #fff;
}

.di-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.di-btn-details {
    background: #2271b1;
    color: #fff;
    cursor: pointer;
}

.di-btn-details:hover {
    background: #135e96;
    color: #fff;
}

/* ========================================
   UNITS COUNT
   ======================================== */
.di-units-count {
    margin-bottom: 12px;
    font-size: 14px;
    color: #646970;
}

/* ========================================
   UNITS TABLE
   ======================================== */
.di-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.di-units-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
}

.di-units-table thead {
    background: #f8f9fa;
}

.di-units-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e4e7;
    white-space: nowrap;
}

.di-units-table th.di-sortable {
    cursor: pointer;
    user-select: none;
}

.di-units-table th.di-sortable:hover {
    background: #eef0f3;
}

.di-units-table th .di-sort-icon {
    margin-left: 4px;
    opacity: 0.3;
}

.di-units-table th .di-sort-icon::after {
    content: "⇅";
    font-size: 11px;
}

.di-units-table th.sorted .di-sort-icon {
    opacity: 1;
}

.di-units-table th.sorted[data-order="ASC"] .di-sort-icon::after {
    content: "↑";
}

.di-units-table th.sorted[data-order="DESC"] .di-sort-icon::after {
    content: "↓";
}

.di-units-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.di-units-table tbody tr {
    transition: background 0.15s;
    cursor: pointer;
}

.di-units-table tbody tr:hover {
    background: #f0f6fc;
}

.di-units-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status row borders */
.di-units-table tr.di-status-row-dostepny { border-left: 4px solid #22c55e; }
.di-units-table tr.di-status-row-zarezerwowany { border-left: 4px solid #eab308; }
.di-units-table tr.di-status-row-sprzedany { border-left: 4px solid #ef4444; opacity: 0.7; }
.di-units-table tr.di-status-row-wycofany { border-left: 4px solid #6b7280; opacity: 0.5; }
.di-units-table tr.di-status-row-niedostepny { border-left: 4px solid #0284c7; }

/* ========================================
   STATUS BADGES
   ======================================== */
.di-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.di-status-dostepny { background: #22c55e; }
.di-status-zarezerwowany { background: #eab308; }
.di-status-sprzedany { background: #ef4444; }
.di-status-wycofany { background: #6b7280; }
.di-status-niedostepny { background: #0284c7; }

/* ========================================
   PRICE DISPLAY
   ======================================== */
.di-price-main {
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

.di-price-sqm {
    font-size: 14px;
    color: #646970;
    margin-top: 2px;
}

.di-price-lowest {
    font-size: 12px;
    color: #646970;
    margin-top: 4px;
    padding: 4px 8px;
    background: #f0f0f1;
    border-radius: 4px;
    display: inline-block;
}

.di-price-before-promo {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

/* Additional costs */
.di-costs-list {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.di-costs-list h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #646970;
}

.di-costs-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.di-costs-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e2e4e7;
    font-size: 13px;
}

.di-costs-list li:last-child {
    border-bottom: none;
}

/* ========================================
   UNIT CARD (MODAL)
   ======================================== */
.di-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e4e7;
}

.di-card-header h2 {
    margin: 0;
    font-size: 22px;
}

.di-card-body {
    padding: 24px;
}

.di-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .di-card-grid {
        grid-template-columns: 1fr;
    }
}

.di-card-section {
    margin-bottom: 20px;
}

.di-card-section h3 {
    font-size: 14px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f1;
}

/* Property details grid */
.di-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.di-detail-item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.di-detail-label {
    font-size: 12px;
    color: #646970;
    font-weight: 600;
    text-transform: uppercase;
}

.di-detail-value {
    font-size: 15px;
    font-weight: 500;
    color: #1d2327;
    margin-top: 2px;
}

/* Floor plan image */
.di-floor-plan-img {
    width: 100%;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    margin-top: 12px;
}

/* Gallery */
.di-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.di-gallery img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.di-gallery img:hover {
    transform: scale(1.05);
}

/* ========================================
   FLOOR PLAN SVG
   ======================================== */
.devinwest-floor-plan-wrapper,
.di-floor-plan-wrapper {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

.devinwest-floor-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.devinwest-floor-nav button {
    padding: 8px 20px;
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.devinwest-floor-nav button:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.devinwest-floor-nav button.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.devinwest-floor-plan-svg,
.di-floor-plan-svg {
    width: 100%;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    overflow: hidden;
}

.devinwest-floor-plan-svg svg,
.di-floor-plan-svg svg {
    width: 100%;
    height: auto;
}

/* SVG unit overlays */
.devinwest-floor-plan-svg [data-unit-id],
.di-floor-plan-svg [data-unit-id] {
    cursor: pointer;
    transition: opacity 0.2s;
}

.devinwest-floor-plan-svg [data-unit-id]:hover,
.di-floor-plan-svg [data-unit-id]:hover {
    opacity: 0.8;
}

/* SVG tooltip */
.di-svg-tooltip,
.di-floor-plan-tooltip {
    position: absolute;
    background: #1d2327;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 250px;
}

.di-svg-tooltip .di-tooltip-number {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.di-svg-tooltip .di-tooltip-price {
    color: #22c55e;
    font-weight: 600;
}

/* ========================================
   INVESTMENT OVERVIEW
   ======================================== */
.devinwest-investment {
    max-width: 1200px;
    margin: 0 auto;
}

.di-investment-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

.di-investment-hero img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.di-investment-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .di-investment-info {
        grid-template-columns: 1fr;
    }
}

.di-developer-info {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 24px;
}

.di-developer-info h3 {
    margin-top: 0;
    color: #2271b1;
    font-size: 16px;
}

.di-developer-detail {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

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

.di-developer-detail .label {
    font-weight: 600;
    color: #646970;
    min-width: 140px;
}

/* ========================================
   PROSPEKT DOWNLOAD
   ======================================== */
.di-prospekt-section {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 24px;
}

.di-prospekt-section h3 {
    margin-top: 0;
}

.di-prospekt-legal-notice {
    font-size: 13px;
    color: #646970;
    margin-bottom: 16px;
}

.di-prospekt-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.di-prospekt-list li {
    margin-bottom: 8px;
}

.di-prospekt-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    text-decoration: none;
    color: #2271b1;
    font-weight: 500;
    transition: all 0.2s;
}

.di-prospekt-link:hover {
    background: #f0f6fc;
    border-color: #2271b1;
}

/* ========================================
   STATISTICS
   ======================================== */
.di-stats-section {
    margin: 20px 0;
}

.di-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.di-stat-item {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.di-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #2271b1;
}

.di-stat-label {
    display: block;
    font-size: 13px;
    color: #646970;
    margin-top: 4px;
}

.di-stat-available .di-stat-value { color: #22c55e; }
.di-stat-reserved .di-stat-value { color: #eab308; }
.di-stat-sold .di-stat-value { color: #ef4444; }

/* ========================================
   MORTGAGE CALCULATOR
   ======================================== */
.di-mortgage-calculator {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
}

.di-mortgage-calculator h3 {
    margin-top: 0;
}

.di-mortgage-disclaimer {
    font-size: 12px;
    color: #646970;
    margin-bottom: 16px;
    font-style: italic;
}

.di-mortgage-field {
    margin-bottom: 16px;
}

.di-mortgage-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.di-mortgage-field input,
.di-mortgage-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
}

.di-mortgage-result {
    margin-top: 20px;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 8px;
}

.di-mortgage-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e4e7;
}

.di-mortgage-result-item:last-child {
    border-bottom: none;
}

.di-mortgage-result-label {
    color: #646970;
    font-size: 14px;
}

.di-mortgage-result-value {
    font-weight: 600;
    font-size: 14px;
}

.di-mortgage-monthly {
    font-size: 20px !important;
    color: #2271b1;
}

/* ========================================
   PRICE HISTORY
   ======================================== */
.devinwest-price-history {
    margin: 20px 0;
}

.di-price-chart-container {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.di-price-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.di-price-history-table th,
.di-price-history-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f1;
}

.di-price-history-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* ========================================
   PAGINATION
   ======================================== */
.di-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.di-pagination button,
.di-pagination a {
    padding: 8px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: #1d2327;
    transition: all 0.15s;
}

.di-pagination button:hover,
.di-pagination a:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.di-pagination button.active,
.di-pagination .di-page-active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.di-pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.di-pagination-info {
    font-size: 13px;
    color: #646970;
    margin-left: 8px;
}

/* ========================================
   LOADING
   ======================================== */
.di-loading {
    text-align: center;
    padding: 40px;
    color: #646970;
    display: none;
}

.di-loading::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e4e7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: di-spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* ========================================
   MODAL OVERLAY
   ======================================== */
.di-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.di-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.di-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
}

.di-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f1;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.di-modal-close:hover {
    background: #ddd;
}

.di-modal-body {
    padding: 24px;
}

.di-modal-loading {
    text-align: center;
    padding: 40px;
    color: #646970;
}

/* ========================================
   CONTACT FORM
   ======================================== */
.di-contact-section {
    margin: 20px 0;
}

.di-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .di-contact-grid {
        grid-template-columns: 1fr;
    }
}

.di-contact-info {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 24px;
}

.di-contact-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.di-contact-item:last-child {
    border-bottom: none;
}

.di-contact-icon {
    color: #2271b1;
}

.di-contact-form-wrapper {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 24px;
}

.di-contact-form h3 {
    margin-top: 0;
}

.di-form-field {
    margin-bottom: 16px;
}

.di-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.di-form-field input,
.di-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
}

.di-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.di-form-consent {
    font-size: 13px;
    color: #646970;
}

.di-form-consent input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

.di-contact-form-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}

/* ========================================
   NO RESULTS
   ======================================== */
.di-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
}

.di-no-results p {
    font-size: 16px;
}

.di-no-documents {
    font-style: italic;
    color: #646970;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .di-filters-bar {
        flex-direction: column;
    }

    .di-filter-group {
        width: 100%;
    }

    .di-filter-group select,
    .di-filter-group input,
    .di-filter-select,
    .di-filter-input {
        width: 100%;
        min-width: auto;
    }

    .di-table-responsive {
        margin: 0 -10px;
    }

    .di-units-table {
        display: block;
        overflow-x: auto;
    }

    .di-card-grid,
    .di-details-grid {
        grid-template-columns: 1fr;
    }

    .di-investment-info {
        grid-template-columns: 1fr;
    }

    .di-filter-range-inputs {
        flex-wrap: wrap;
    }
}

.di-unit-unavailable-note {
    margin: 0;
    padding: 12px 14px;
    background: #f1f5f9;
    border-left: 4px solid #0284c7;
    border-radius: 4px;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}
