/**
 * Apartments List Styles
 * Nowy layout zgodny z apartment-list.html i apartment-detail.html
 * @package Develogic
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   Loading Spinner
   =========================== */
.develogic-apartments-container {
    position: relative;
    min-height: 400px;
}

.develogic-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 400px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.develogic-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.develogic-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.develogic-spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-top-color: #333;
    border-radius: 50%;
    animation: develogic-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.develogic-spinner-ring:nth-child(1) {
    width: 60px;
    height: 60px;
    animation-delay: -0.45s;
}

.develogic-spinner-ring:nth-child(2) {
    width: 48px;
    height: 48px;
    top: 6px;
    left: 6px;
    animation-delay: -0.3s;
    border-top-color: #666;
}

.develogic-spinner-ring:nth-child(3) {
    width: 36px;
    height: 36px;
    top: 12px;
    left: 12px;
    animation-delay: -0.15s;
    border-top-color: #999;
}

.develogic-spinner-ring:nth-child(4) {
    width: 24px;
    height: 24px;
    top: 18px;
    left: 18px;
    border-top-color: #ccc;
}

@keyframes develogic-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.develogic-loading-text {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.develogic-apartments-container .container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.develogic-apartments-container.loaded .container {
    opacity: 1;
}

/* ===========================
   Apartment List Page
   =========================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    margin-bottom: 30px;
}

.stats {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
}

.title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}

.sort-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.sort-label {
    color: #999;
}

.sort-option {
    cursor: pointer;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.sort-option:hover {
    color: #333;
}

.sort-option.active {
    border-bottom-color: #333;
    color: #333;
}

.sort-arrow {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    width: 12px;
    height: 14px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.sort-option:hover .sort-arrow {
    opacity: 0.5;
}

.sort-option.active .sort-arrow {
    opacity: 1;
}

.sort-arrow svg {
    width: 12px;
    height: 7px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

/* Show only up arrow when sorting ascending */
.sort-option[data-direction="asc"] .sort-arrow .arrow-up {
    opacity: 1;
}

.sort-option[data-direction="asc"] .sort-arrow .arrow-down {
    opacity: 0.2;
}

/* Show only down arrow when sorting descending */
.sort-option[data-direction="desc"] .sort-arrow .arrow-up {
    opacity: 0.2;
}

.sort-option[data-direction="desc"] .sort-arrow .arrow-down {
    opacity: 1;
}

/* ===========================
   Filter Section
   =========================== */
.filter-section {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    margin: 30px 0 20px;
    border: 1px solid #e5e7eb;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 200px;
}

.filter-selects-wrapper {
    display: flex;
    gap: 20px;
    flex: 1 1 auto;
}

.filter-selects-wrapper .filter-group {
    flex: 1 1 auto;
    min-width: 150px;
}

.filter-group.filter-extras {
    flex: 2 1 auto;
    min-width: 400px;
}

.filter-group.filter-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    align-items: flex-end;
    min-width: auto;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: block;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.filter-chip:hover {
    border-color: var(--develogic-primary-color);
    background: #f0f7ff;
    color: var(--develogic-primary-color);
}

.filter-chip.active {
    background: var(--develogic-primary-color);
    border-color: var(--develogic-primary-color);
    color: white;
}

/* Filter Select */
.filter-select {
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    font-weight: 500;
}

.filter-select:hover {
    border-color: var(--develogic-primary-color);
}

.filter-select:focus {
    border-color: var(--develogic-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Filter Range */
.filter-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: white;
    outline: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-input:hover {
    border-color: var(--develogic-primary-color);
}

.filter-input:focus {
    border-color: var(--develogic-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.filter-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.filter-separator {
    color: #9ca3af;
    font-weight: 500;
}

/* Filter Checkboxes */
.filter-checkboxes {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--develogic-primary-color);
}

.filter-checkbox:hover {
    color: var(--develogic-primary-color);
}

/* Show More Filters Button (hidden on desktop) */
.mobile-only {
    display: none;
}

/* Filter Reset Button */
.filter-reset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-reset-btn:hover {
    border-color: #dc2626;
    background: #fef2f2;
    color: #dc2626;
}

.filter-reset-btn svg {
    width: 16px;
    height: 16px;
}

/* Active filter count indicator */
.filter-active-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--develogic-primary-color);
    border-radius: 50%;
    margin-left: 4px;
}

.apartment-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #e5e5e5;
    border: 1px solid #e5e5e5;
    margin-top: 20px;
}

.apartment-item {
    display: grid;
    grid-template-columns: 180px 280px 1fr 180px 100px;
    gap: 30px;
    padding: 30px;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
    align-items: center;
}

.apartment-item:hover {
    background: #f9f9f9;
}

/* Highlight animation for apartment scroll-to */
.apartment-item.apartment-highlight {
    animation: highlightPulse 5s ease-in-out;
    background: #fffbf0;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.5);
}

@keyframes highlightPulse {
    0% {
        background: #fffbf0;
        box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.5);
    }
    40% {
        background: #fffef8;
        box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.4);
    }
    100% {
        background: white;
        box-shadow: none;
    }
}

.apartment-item[style*="display: none"] {
    display: none !important;
}

.apartment-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.building-name {
    font-size: 14px;
    color: #999;
}

.apartment-number {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.status-badge {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 0;
    color: #00b341;
}

.status-badge.reserved {
    color: #ff9500;
}

.status-badge.sold {
    color: #8b0000;
}

.apartment-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.detail-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    font-size: 14px;
}

.detail-label {
    color: #666;
}

.detail-value {
    color: #1a1a1a;
    font-weight: 600;
    text-transform: capitalize;
    word-break: break-word;
    overflow-wrap: break-word;
}

.features {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 6px;
}

.apartment-images {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.apartment-image {
    width: 100px;
    height: 100px;
}

.apartment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #e5e5e5;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    color: #999;
    font-size: 12px;
    text-align: center;
}

.apartment-price {
    text-align: right;
    position: relative;
}

.price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.price-old {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.price-main {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.apartment-item[data-has-promo="true"] .price-main {
    color: #00b341;
}

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

.price-omnibus-label {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    margin-bottom: 2px;
}

.price-omnibus-value {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

/* Promo badge for apartment list */
.promo-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(238, 90, 111, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(238, 90, 111, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(238, 90, 111, 0.5);
    }
}

.apartment-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e5e5e5;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.icon-btn:hover {
    border-color: var(--develogic-primary-color);
    color: var(--develogic-primary-color);
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #666;
    stroke-width: 2;
}

.icon-btn.favorited svg {
    fill: #333;
    stroke: none;
}

/* 3D Tour icon button */
.icon-btn-3d {
    text-decoration: none;
}

.icon-btn-3d svg {
    stroke: #666;
}

.icon-btn-3d:hover svg {
    stroke: var(--develogic-primary-color);
}

/* 360 degree text button */
.icon-btn-360 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-360 .text-360 {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    line-height: 1;
}

.icon-btn-360:hover .text-360 {
    color: var(--develogic-primary-color);
}

/* Mobile-only button - hidden on desktop */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
}

/* Tooltips for icon buttons */
.icon-btn[title],
.icon-btn-3d[title] {
    position: relative;
}

.icon-btn[title]::after,
.icon-btn-3d[title]::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #333;
    color: white;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.icon-btn[title]::before,
.icon-btn-3d[title]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.icon-btn[title]:hover::after,
.icon-btn-3d[title]:hover::after,
.icon-btn[title]:hover::before,
.icon-btn-3d[title]:hover::before {
    opacity: 1;
}

/* ===========================
   Apartment Detail Modal
   =========================== */
.apartment-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
}

.modal-overlay {
    display: none;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    background: white;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.6;
}

.modal-close svg {
    width: 32px;
    height: 32px;
    stroke: #000;
    stroke-width: 2;
}

.modal-header {
    padding: 6px 40px 6px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    line-height: 1;
    display: flex;
    align-items: center;
}

.modal-header .action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Desktop-only class - hidden on mobile */
.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Contact phone in action buttons (desktop only) */
.contact-phone-desktop {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    color: #374151;
    font-weight: 500;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    white-space: nowrap;
    margin-right: 100px;
}

.contact-phone-desktop .phone-label {
    color: #6b7280;
    font-weight: 600;
}

.contact-phone-desktop .phone-number {
    color: #1f2937;
    font-weight: 600;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 400px;
    flex: 1;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

/* Gallery Section */
.modal-gallery {
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.gallery-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 70vh;
    min-height: 500px;
    width: 100%;
    max-width: 100%;
}

/* Promo badge for modal gallery */
.gallery-promo-badge {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 16px rgba(238, 90, 111, 0.4);
    animation: pulse-badge-gallery 2.5s ease-in-out infinite;
}

.gallery-promo-badge::before {
    content: '⚡';
    font-size: 20px;
}

@keyframes pulse-badge-gallery {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(238, 90, 111, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(238, 90, 111, 0.6);
    }
}

.gallery-main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
    margin: 0 auto;
}

.gallery-main.zoomed {
    overflow: auto;
    cursor: grab;
}

.gallery-main.zoomed:active {
    cursor: grabbing;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
    z-index: 10;
}

.gallery-nav:hover {
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav svg {
    width: 20px;
    height: 20px;
}

.gallery-nav.prev {
    left: 30px;
}

.gallery-nav.next {
    right: 30px;
}

.gallery-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.gallery-control {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.gallery-control:hover {
    background: #f5f5f5;
}

.gallery-control svg {
    width: 20px;
    height: 20px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 20px;
    overflow-x: auto;
    background: white;
}

.gallery-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.gallery-thumbnail:hover {
    border-color: var(--develogic-primary-color);
}

.gallery-thumbnail.active {
    border-color: var(--develogic-primary-color);
}

/* Fullscreen styles */
.gallery-main:-webkit-full-screen,
.gallery-main:-moz-full-screen,
.gallery-main:-ms-fullscreen,
.gallery-main:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.gallery-main:-webkit-full-screen .gallery-main-image,
.gallery-main:-moz-full-screen .gallery-main-image,
.gallery-main:-ms-fullscreen .gallery-main-image,
.gallery-main:fullscreen .gallery-main-image {
    max-width: 100vw;
    max-height: 100vh;
}

.gallery-main:-webkit-full-screen .gallery-nav,
.gallery-main:-moz-full-screen .gallery-nav,
.gallery-main:-ms-fullscreen .gallery-nav,
.gallery-main:fullscreen .gallery-nav {
    z-index: 1000000;
}

.gallery-main:-webkit-full-screen .gallery-controls,
.gallery-main:-moz-full-screen .gallery-controls,
.gallery-main:-ms-fullscreen .gallery-controls,
.gallery-main:fullscreen .gallery-controls {
    z-index: 1000000;
}

/* Modal Details Section */
.modal-details {
    padding: 16px 40px 30px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-transform: capitalize;
}

.location {
    font-size: 13px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.unit-name {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
    padding-bottom: 0;
    margin-bottom: 0;
}

.status {
    font-size: 15px;
    font-weight: 600;
}

.detail-specs {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.spec-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    font-size: 15px;
}

.spec-label {
    color: #666;
}

.spec-value {
    color: #1a1a1a;
    font-weight: 600;
}

.detail-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
}

.detail-feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    font-weight: 500;
    font-size: 13px;
    line-height: 1;
}

.detail-price {
    padding: 14px 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.detail-price .price-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.detail-price .price-main {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.detail-price .price-main.promo-price {
    color: #00b341;
}

.detail-price .price-per-m2 {
    font-size: 15px;
    color: #666;
    margin-top: 3px;
}

/* Omnibus price section */
.detail-price-omnibus {
    padding: 6px 0 12px 0;
}

.detail-price-omnibus .omnibus-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.detail-price-omnibus .omnibus-value {
    font-size: 18px;
    font-weight: 600;
    color: #666;
}

/* Promo badge for modal price section */
.detail-price .promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 8px;
    box-shadow: 0 3px 12px rgba(238, 90, 111, 0.35);
}

.detail-price .promo-badge::before {
    content: '⚡';
    font-size: 14px;
}

/* ===========================
   Price History
   =========================== */
.detail-price-history {
    padding: 12px 0;
    border-top: 1px solid #e5e5e5;
}

.price-history-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.price-history-content {
    position: relative;
    min-height: 60px;
}

.price-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.price-history-table thead {
    background: #f9f9f9;
}

.price-history-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #e5e5e5;
}

.price-history-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #1a1a1a;
    border-bottom: 1px solid #f5f5f5;
}

.price-history-table tbody tr:last-child td {
    border-bottom: none;
}

.price-history-table tbody tr:hover {
    background: #fafafa;
}

.price-history-table .date-cell {
    color: #666;
    font-size: 13px;
}

.price-history-table .value-cell {
    font-weight: 600;
    text-align: right;
}

.price-history-empty {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

/* Loader dla historii cen */
.price-history-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.price-history-loader::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #e5e5e5;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.info-box {
    background: #fafafa;
    padding: 20px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.download-link svg {
    width: 18px;
    height: 18px;
}

/* 3D Tour Link Styles */
.tour-3d-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 20px 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

/* Promo Banner Link Styles (full width like 3D tour) */
.promo-banner-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 0;
    margin-bottom: 12px;
    padding: 20px 20px !important;
    height: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 111, 0.4);
    position: relative;
    overflow: hidden;
    animation: pulse-promo 2s ease-in-out infinite;
}

@keyframes pulse-promo {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(238, 90, 111, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(238, 90, 111, 0.6);
    }
}

.promo-banner-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.promo-banner-link:hover::before {
    left: 100%;
}

.tour-3d-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.tour-3d-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.tour-3d-link:hover::before {
    left: 100%;
}

.tour-3d-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.tour-3d-link svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.tour-3d-link svg:first-child {
    animation: pulse 2s ease-in-out infinite;
}

.tour-3d-text {
    flex: 1;
    text-align: center;
}

.tour-3d-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.tour-3d-link:hover .tour-3d-arrow {
    transform: translateX(5px);
}

/* Download Card Link - green variant */
.download-card-link {
    background: linear-gradient(135deg, #28a745 0%, #20833b 100%);
    margin-top: 0;
    padding: 20px 20px;
    height: 20px;
}

.download-card-link:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.download-card-link:active {
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.4);
}

.promo-banner-link svg {
    width: 24px;
    height: 24px;
}

.promo-banner-link svg:first-child {
    stroke: currentColor;
    animation: pulse 2s ease-in-out infinite;
}

.promo-banner-text {
    flex: 1;
    text-align: center;
}

.promo-banner-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    animation: rotate-star 4s linear infinite;
}

@keyframes rotate-star {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.detail-actions,
.action-buttons {
    display: flex;
    gap: 15px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: white;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.download-btn svg {
    width: 20px;
    height: 20px;
}

.download-btn:hover {
    background: #1a1a1a;
    color: white;
}

.apartment-detail-modal .icon-btn {
    width: 44px;
    height: 44px;
}

.apartment-detail-modal .icon-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #666;
    stroke-width: 2;
}

.apartment-detail-modal .icon-btn.favorited svg {
    fill: #333;
    stroke: none;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1200px) {
    .apartment-item {
        grid-template-columns: 150px 250px 1fr 150px 80px;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .apartment-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .apartment-images {
        justify-content: flex-start;
    }

    .apartment-price {
        text-align: left;
    }

    .apartment-actions {
        display: flex;
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .detail-row {
        grid-template-columns: 100px 1fr;
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-details {
        max-height: 50vh;
        padding: 12px 30px 24px 30px;
        gap: 12px;
    }

    .unit-name {
        font-size: 28px;
    }

    .gallery-main {
        height: 50vh;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
    }

    .sort-bar {
        flex-wrap: wrap;
    }

    .modal-header {
        padding: 5px 20px 5px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
    }

    .modal-header .action-buttons {
        margin-right: 45px;
        gap: 8px;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-details {
        padding: 10px 20px 20px 20px;
        gap: 10px;
    }

    .detail-header {
        gap: 2px;
    }

    .unit-name {
        font-size: 24px;
    }

    .location {
        font-size: 12px;
    }

    .status {
        font-size: 14px;
    }

    .spec-item {
        font-size: 14px;
        grid-template-columns: 100px 1fr;
        gap: 12px;
    }

    .detail-price {
        padding: 10px 0;
    }

    .detail-price .price-main {
        font-size: 24px;
    }

    .detail-price .price-per-m2 {
        font-size: 14px;
    }

    .detail-price-omnibus .omnibus-value {
        font-size: 16px;
    }

    .gallery-main {
        height: 40vh;
        min-height: 300px;
    }
    
    .tour-3d-link {
        padding: 20px 20px;
        font-size: 14px;
    }
    
    .tour-3d-link svg {
        width: 18px;
        height: 18px;
    }
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* ===========================
   Toast Notification
   =========================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
}

.toast {
    background: white;
    color: #1f2937;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    transform: translateX(400px);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    color: #111827;
}

.toast-link {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    cursor: pointer;
}

.toast-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

@media (max-width: 640px) {
    .toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ===========================
   Favorites View Toggle
   =========================== */
.favorites-toggle-container {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.toggle-buttons-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sort-bar-right {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    color: #666;
    margin-left: auto;
}

.favorites-toggle-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorites-toggle-btn:hover {
    border-color: var(--develogic-primary-color);
    color: var(--develogic-primary-color);
}

.favorites-toggle-btn.active {
    background: var(--develogic-primary-color);
    color: white;
    border-color: var(--develogic-primary-color);
}

.favorites-toggle-btn svg {
    width: 18px;
    height: 18px;
}

.favorites-count {
    font-size: 14px;
    color: #666;
}

.apartment-list.hide-favorites .apartment-item:not(.is-favorite) {
    display: none;
}

.apartment-list.hide-favorites.has-no-favorites .apartment-item {
    display: none;
}

.apartment-list.hide-favorites.has-no-favorites .no-favorites-placeholder {
    display: flex !important;
}

.no-favorites-placeholder {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    background: white;
    color: #666;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.placeholder-icon svg {
    width: 40px;
    height: 40px;
    stroke: #ccc;
    fill: none;
}

.no-favorites-placeholder h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.no-favorites-placeholder p {
    font-size: 16px;
    color: #999;
    max-width: 400px;
    line-height: 1.5;
}

/* ===========================
   Share Buttons
   =========================== */
.favorites-share-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
    border-left: 1px solid #e5e5e5;
}

.share-label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.share-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-twitter {
    color: #1DA1F2;
}

.share-twitter:hover {
    background: #1DA1F2;
    color: white;
}

.share-facebook {
    color: #1877F2;
}

.share-facebook:hover {
    background: #1877F2;
    color: white;
}

.share-email {
    color: #666;
}

.share-email:hover {
    background: #666;
    color: white;
}

@media (max-width: 768px) {
    .favorites-toggle-container {
        flex-wrap: wrap;
    }
    
    .toggle-buttons-wrapper {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .favorites-count {
        width: 100%;
        display: block;
        font-size: 13px;
        margin-top: 8px;
        padding-left: 4px;
    }
    
    .sort-bar-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        border-top: 1px solid #e5e5e5;
        padding-top: 15px;
        margin-top: 15px;
        flex-wrap: wrap;
        gap: 12px 16px;
    }
    
    .sort-label {
        width: 100%;
        font-size: 13px;
        margin-bottom: 4px;
        font-weight: 600;
    }
    
    .sort-option {
        font-size: 13px;
        padding: 6px 12px;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        background: white;
    }
    
    .favorites-share-container {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #e5e5e5;
        padding-top: 15px;
        margin-top: 15px;
        width: 100%;
    }
    
    .filter-section {
        padding: 12px;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .filter-group {
        width: 100%;
        min-width: 100%;
        gap: 4px;
    }
    
    .filter-group.filter-extras {
        min-width: 100%;
    }
    
    .filter-selects-wrapper {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .filter-selects-wrapper .filter-group {
        width: 100%;
        min-width: 100%;
    }
    
    .filter-chips {
        justify-content: flex-start;
    }
    
    .filter-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-reset-btn {
        width: 100%;
        justify-content: center;
    }
    
    .filter-range {
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .filter-input {
        min-width: 0;
        width: 100%;
        font-size: 13px;
        padding: 10px 8px;
    }
    
    .filter-separator {
        flex-shrink: 0;
        font-size: 13px;
    }
    
    /* Hide additional filters on mobile by default */
    .filter-mobile-hidden {
        display: none !important;
    }
    
    /* Show filters when expanded */
    .filter-mobile-hidden.filter-mobile-visible {
        display: flex !important;
    }
    
    /* Show more filters button (mobile only) */
    .filter-show-more-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 10px 18px;
        background: white;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
        margin-bottom: 10px;
    }
    
    .filter-show-more-btn:hover {
        border-color: var(--develogic-primary-color);
        background: #f0f7ff;
        color: var(--develogic-primary-color);
    }
    
    .filter-show-more-btn .filter-arrow-icon {
        width: 16px;
        height: 16px;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    .filter-show-more-btn[aria-expanded="true"] .filter-arrow-icon {
        transform: rotate(180deg);
    }
    
    /* Show button only on mobile - use flex to preserve icon-btn styles */
    .mobile-only {
        display: flex;
    }
    
    /* Ensure icon buttons keep their flex display */
    .icon-btn.mobile-only {
        display: flex;
    }
    
    /* Fix detail-row on mobile - reduce label width and gap */
    .detail-row {
        grid-template-columns: 90px 1fr;
        gap: 10px;
        font-size: 13px;
    }
    
    /* Fix apartment-actions on mobile - ensure buttons don't overflow */
    .apartment-actions {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .apartment-actions .icon-btn {
        flex-shrink: 0;
        min-width: 44px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .filter-input {
        font-size: 12px;
        padding: 8px 6px;
    }
    
    .filter-input::placeholder {
        font-size: 11px;
    }
    
    .filter-separator {
        font-size: 12px;
        padding: 0 2px;
    }
    
    .filter-label {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .filter-select {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .filter-chip {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .filter-checkbox {
        font-size: 13px;
    }
    
    .filter-reset-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .favorites-toggle-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .favorites-toggle-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .sort-option {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .favorites-count {
        font-size: 12px;
    }
    
    .sort-label {
        font-size: 12px;
    }
    
    /* Further reduce detail-row on very small screens */
    .detail-row {
        grid-template-columns: 80px 1fr;
        gap: 8px;
        font-size: 12px;
    }
    
    .apartment-actions {
        gap: 8px;
    }
    
    .apartment-actions .icon-btn {
        min-width: 40px;
        width: 40px;
        height: 40px;
    }
}
