/* ============================================
   HITYREALITY.CZ - STYLY
   ============================================
   Modrý design - kompaktní a responsive
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0057B7;
    --primary-dark: #004494;
    --primary-light: #3380CC;
    --background: #F8F9FA;
    --white: #FFFFFF;
    --neutral-100: #F8F9FA;
    --neutral-200: #E9ECEF;
    --neutral-300: #DEE2E6;
    --neutral-400: #CED4DA;
    --neutral-500: #ADB5BD;
    --neutral-600: #6C757D;
    --neutral-700: #495057;
    --neutral-800: #343A40;
    --neutral-900: #212529;
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 1.875rem;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--neutral-900);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
}

.container-full {
    width: 100%;
    padding: 0;
}

/* ============================================
   HERO SECTION
============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: var(--space-sm) var(--space-md);
}

.hero-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xs);
}

.logo-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    transition: all 0.3s ease;
}

.logo-title-row .logo-container {
    background-color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.logo-title-row .logo-image {
    height: 32px;
}

.logo-title-row .logo {
    font-family: Calibri, Arial, sans-serif;
    font-size: calc(var(--font-size-lg) + 4px);
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.logo-title-row .logo-red {
    color: #e53935;
}

.logo-title-row .logo-cz {
    font-size: calc(var(--font-size-lg) - 2px);
    color: var(--primary);
}

.hero-title-inline {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--white);
    margin: 0;
}

/* ============================================
   SEARCH PANEL
============================================ */
.search-panel {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 100%;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.search-row:last-child {
    margin-bottom: 0;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-field label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 4px;
}

.search-input,
.search-select {
    padding: var(--space-xs) var(--space-sm);
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.search-input:focus,
.search-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.1);
}

.search-actions {
    display: flex;
    gap: var(--space-xs);
    align-items: flex-end;
}

/* ============================================
   FILTER PILLS
============================================ */
.filter-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--space-sm);
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    background-color: var(--white);
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    color: var(--neutral-700);
    cursor: pointer;
    transition: var(--transition);
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-pill.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.filter-pill svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* ============================================
   BUTTONS
============================================ */
.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--neutral-200);
    color: var(--neutral-800);
}

.btn-secondary:hover {
    background-color: var(--neutral-300);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   PROPERTIES SECTION
============================================ */
.properties-section {
    padding: var(--space-sm);
}

.properties-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-sm);
    min-height: calc(100vh - 250px);
}

.properties-list-side {
    overflow-y: auto;
    height: calc(100vh - 100px);
    padding-right: var(--space-sm);
}

.section-header {
    margin-bottom: var(--space-sm);
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--neutral-900);
}

.properties-count {
    color: var(--neutral-600);
    font-size: var(--font-size-sm);
}

/* ============================================
   PROPERTIES GRID
============================================ */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-sm);
}

.property-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.property-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.property-content {
    padding: var(--space-sm);
}

.property-category {
    display: inline-block;
    padding: 2px 6px;
    background-color: rgba(0, 87, 183, 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.property-type {
    display: inline-block;
    padding: 2px 6px;
    background-color: rgba(0, 87, 183, 0.15);
    color: #0057B7;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-right: var(--space-xs);
    margin-bottom: var(--space-xs);
}

/* Oznámení badge */
.property-announcement {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.property-announcement.novinka {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.property-announcement.sleva {
    background-color: #FFF8E1;
    color: #F57F17;
}

.property-announcement.zmenaceneny,
.property-announcement.změnaceneny,
.property-announcement.změna-ceny,
.property-announcement.zmena-ceny {
    background-color: #FFF3E0;
    color: #EF6C00;
}

.property-announcement.rezervace {
    background-color: #FFF3E0;
    color: #EF6C00;
}

.property-announcement.volne,
.property-announcement.volné {
    background-color: #E3F2FD;
    color: #1565C0;
}

.property-announcement.proidane,
.property-announcement.prodáno,
.property-announcement.pronajato {
    background-color: #FFEBEE;
    color: #C62828;
}

.property-name {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-xs);
}

.property-image-wrapper {
    position: relative;
}

.image-count-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.property-description {
    color: var(--neutral-700);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-price {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   MAP
============================================ */
.map-side {
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
}

.map-container {
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

#map {
    height: 100%;
    width: 100%;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
}

.map-popup {
    min-width: 200px;
}

.map-popup-title {
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-xs);
}

.map-popup-price {
    color: var(--primary);
    font-weight: 700;
}

.popup-price {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

/* ============================================
   MODAL
============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    touch-action: pan-y; /* Allow vertical scroll */
}

.modal-large {
    width: 800px;
}

.modal-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 32px;
    height: 32px;
    border: none;
    background-color: var(--neutral-200);
    color: var(--neutral-700);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--danger);
    color: var(--white);
}

.detail-gallery {
    position: relative;
}

.detail-gallery-main {
    position: relative;
    height: 400px;
    background-color: var(--neutral-100);
}

.detail-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Touch feedback for gallery - allow horizontal swipe */
.detail-gallery-main {
    touch-action: pan-y;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--neutral-700);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.gallery-arrow:hover {
    background-color: var(--white);
    box-shadow: var(--shadow-md);
}

.gallery-prev {
    left: var(--space-sm);
}

.gallery-next {
    right: var(--space-sm);
}

.gallery-counter {
    position: absolute;
    bottom: var(--space-sm);
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.detail-gallery-thumbs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm);
    overflow-x: auto;
    background-color: var(--neutral-100);
}

.detail-gallery-thumbs img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
}

.detail-gallery-thumbs img:hover,
.detail-gallery-thumbs img.active {
    opacity: 1;
}

/* Scroll indicator for detail page */
.detail-scroll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    background-color: var(--neutral-100);
    margin-top: -6px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: var(--transition);
}

.detail-scroll-indicator:hover {
    background-color: var(--neutral-200);
}

.detail-scroll-indicator span {
    font-size: 12px;
    color: var(--neutral-600);
    font-weight: 500;
}

.scroll-arrow {
    width: 14px;
    height: 14px;
    color: var(--neutral-600);
    animation: bounce-down 1.5s infinite;
}

@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(3px);
    }
    60% {
        transform: translateY(1px);
    }
}

/* Street View styles */
.detail-streetview {
    padding: var(--space-lg);
    background: var(--neutral-100);
    border-top: 1px solid var(--neutral-200);
}

.detail-streetview h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-md);
    color: var(--neutral-800);
}

.detail-streetview h3 svg {
    color: var(--primary);
}

.streetview-header-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    margin-left: auto;
    border: none;
    cursor: pointer;
}

.streetview-header-btn svg {
    flex-shrink: 0;
    stroke: white;
}

.streetview-header-btn:hover {
    background: var(--primary-dark);
    color: white;
}

/* Google Maps button variant */
.streetview-google-btn {
    background: #4285F4;
}

.streetview-google-btn:hover {
    background: #3367D6;
}

/* Mapy.cz button variant */
.streetview-mapy-btn {
    background: #E84E38;
}

.streetview-mapy-btn:hover {
    background: #D6452C;
}

/* 360° foto label */
.streetview-labels {
    font-size: var(--font-size-lg);
    color: var(--neutral-800);
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.streetview-container {
    width: 100%;
    height: 250px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--neutral-200);
}

.streetview-map-wrapper {
    width: 100%;
    height: 400px;
}

.streetview-map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.streetview-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition);
}

.streetview-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.streetview-link svg {
    width: 16px;
    height: 16px;
}

/* Video thumb styles */
.thumb-video {
    width: 80px;
    height: 60px;
    background: var(--neutral-800);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
}

.thumb-video svg {
    color: var(--white);
    margin-bottom: 2px;
}

.thumb-video span {
    font-size: 9px;
    color: var(--white);
    font-weight: 600;
}

.thumb-video:hover,
.thumb-video.active {
    opacity: 1;
    border-color: var(--primary);
}

.detail-content {
    padding: var(--space-lg);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.detail-header .property-announcement {
    margin-left: auto;
}

.detail-category {
    background-color: rgba(0, 87, 183, 0.1);
    color: var(--primary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.detail-name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-sm);
}

.detail-price {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.detail-meta-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.detail-meta-item svg {
    flex-shrink: 0;
    color: var(--primary);
}

.detail-description {
    margin-bottom: var(--space-lg);
    line-height: 1.8;
}

.detail-realtor {
    background-color: var(--neutral-100);
    padding: var(--space-md);
    border-radius: var(--radius-md);
}

.detail-realtor h3 {
    margin-bottom: var(--space-sm);
    color: var(--neutral-700);
}

.realtor-card {
    display: flex;
    gap: var(--space-md);
}

.realtor-info h4 {
    margin-bottom: var(--space-xs);
}

.realtor-info a {
    color: var(--primary);
}

/* ============================================
   LOADING & ERROR
============================================ */
.loading {
    text-align: center;
    padding: var(--space-xl);
    color: var(--neutral-600);
}

.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.error:empty {
    display: none;
}

/* ============================================
   UTILITY CLASSES
============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.visible { display: block !important; }

/* Responsive - tablet/mobile breakpoint (400px) */
@media (max-width: 400px) {
    .hero {
        padding: var(--space-sm);
    }
    
    .hero-header {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .logo-title-row {
        gap: var(--space-sm);
    }
    
    .logo-title-row .logo-container {
        padding: var(--space-xs) var(--space-sm);
    }
    
    .hero-title-inline {
        font-size: var(--font-size-lg);
        width: 100%;
        text-align: center;
    }
}

/* Tablet breakpoint (768px) */
@media (max-width: 768px) {
    .properties-layout {
        grid-template-columns: 1fr;
    }
    
    .properties-list-side {
        height: auto;
        max-height: none;
    }
    
    .map-side {
        position: relative;
        height: 300px;
        margin-top: var(--space-lg);
    }
    
    .footer {
        display: block !important;
        visibility: visible !important;
        position: relative;
        z-index: 10;
        background-color: var(--background);
    }
    
    .map-side {
        z-index: 1;
    }
}

/* Responsive - small mobile breakpoint (350px) */
@media (max-width: 350px) {
    .hero {
        padding: var(--space-xs);
    }
    
    .hero-header {
        width: 100%;
    }
    
    .logo-title-row {
        flex-direction: column;
        gap: var(--space-xs);
        width: 100%;
    }
    
    .logo-title-row .logo-container {
        width: 100%;
        justify-content: center;
        padding: var(--space-sm);
    }
    
    .hero-title-inline {
        font-size: var(--font-size-lg);
        text-align: center;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .properties-layout {
        grid-template-columns: 1fr;
    }
    
    .properties-list-side {
        height: auto;
        max-height: none;
    }
    
    .map-side {
        height: 300px;
        position: static;
    }
    
    .modal-large {
        width: 95%;
        max-width: none;
        margin: 0 auto;
    }
    
    .footer {
        display: block !important;
        visibility: visible !important;
        position: relative;
        z-index: 10;
        background-color: var(--background);
    }
}

/* ============================================
   FOOTER
============================================ */
.footer {
    background-color: var(--neutral-100);
    border-top: 1px solid var(--neutral-300);
    padding: var(--space-md);
    text-align: center;
    margin-top: var(--space-md);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.footer-text {
    color: var(--neutral-600);
    font-size: var(--font-size-sm);
}

.footer-logo-img {
    height: 30px;
    vertical-align: middle;
    margin-top: -0.5%;
}
