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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #1a1a1a;
    color: #e0e0e0;
    -webkit-tap-highlight-color: transparent;
}

.container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 45px);
}

/* Compact Search Bar (Mobile First) */
.search-bar {
    background: #242424;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.search-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.search-compact input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    font-size: 14px;
    background: #2a2a2a;
    color: #e0e0e0;
}

.input-with-info {
    position: relative;
    width: 100%;
}

.input-with-info input {
    width: 100%;
    padding: 10px 40px 10px 10px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    font-size: 14px;
    background: #2a2a2a;
    color: #e0e0e0;
}

.info-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #0ea5e9;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background 0.2s;
}

.info-icon:hover {
    background: rgba(14, 165, 233, 0.1);
}

.info-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 12px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.info-tooltip.show {
    display: block !important;
}

.info-tooltip-content {
    font-size: 12px;
    line-height: 1.5;
    color: #e0e0e0;
}

.info-tooltip-content strong {
    display: block;
    color: #0ea5e9;
    margin-bottom: 6px;
    font-size: 13px;
}

.info-tooltip-content p {
    margin: 6px 0;
}

.info-tooltip-content em {
    color: #888;
}

.search-row-compact {
    display: grid;
    grid-template-columns: 1fr 1fr 70px;
    gap: 6px;
}

.search-row-compact input,
.search-row-compact select {
    padding: 8px 6px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    font-size: 12px;
    background: #2a2a2a;
    color: #e0e0e0;
    min-width: 0;
}

.search-row-compact input[type="number"] {
    position: relative;
}

.search-row-compact input[type="number"]::after {
    content: '€';
    position: absolute;
    right: 8px;
    color: #888;
}

.search-actions-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.search-actions-compact button {
    padding: 10px 16px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.search-actions-compact button:disabled {
    background: #3a3a3a;
    cursor: not-allowed;
}

.search-actions-compact button.cancel {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Mobile Progress Bar */
.progress-info-mobile {
    background: rgba(14, 165, 233, 0.15);
    padding: 6px 8px;
    display: none;
    border-bottom: 1px solid rgba(14, 165, 233, 0.3);
}

.progress-info-mobile.active {
    display: block;
}

.progress-text-mobile {
    font-size: 11px;
    color: #0ea5e9;
    font-weight: 600;
    margin-bottom: 4px;
}

.progress-bar-mobile {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill-mobile {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
    width: 0%;
    transition: width 0.3s;
}

/* Desktop Results Panel - Hidden on Mobile */
.results-panel {
    display: none;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: #1a1a1a;
}

#map {
    width: 100%;
    height: 100%;
    filter: brightness(0.9) contrast(1.1);
}

.status-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #242424;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
    border: 1px solid #3a3a3a;
    max-width: 90%;
    font-size: 12px;
}

.status-bar.visible {
    display: block;
}

.status-bar.loading {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    border-color: rgba(14, 165, 233, 0.3);
}

.status-bar.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.status-bar.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #0ea5e9;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* Mobile Fullscreen Popup */
.mobile-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a1a;
    z-index: 10000;
    overflow-y: auto;
}

.mobile-popup.show {
    display: flex;
    flex-direction: column;
}

.mobile-popup-header {
    background: #242424;
    padding: 12px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid #3a3a3a;
}

.mobile-popup-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-popup-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.popup-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 12px;
    line-height: 1.4;
}

.popup-price {
    font-size: 28px;
    font-weight: 700;
    color: #0ea5e9;
    margin-bottom: 16px;
}

.popup-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.popup-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 14px;
}

.popup-meta-icon {
    font-size: 18px;
}

.popup-link {
    display: block;
    padding: 14px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
}

/* Footer */
.footer {
    background: #242424;
    border-top: 1px solid #2a2a2a;
    padding: 10px 12px;
    height: 45px;
    display: flex;
    align-items: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: 11px;
}

.footer-links {
    display: flex;
    gap: 12px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 11px;
}

.footer-info {
    display: none;
}

/* Privacy Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #242424;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content h2 {
    background: #2a2a2a;
    padding: 16px;
    margin: 0;
    color: #e0e0e0;
    border-bottom: 1px solid #3a3a3a;
    font-size: 18px;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    font-size: 13px;
    line-height: 1.6;
}

.modal-body h3 {
    color: #0ea5e9;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 16px;
}

.modal-body h4 {
    color: #888;
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 13px;
}

.modal-body p {
    margin-bottom: 10px;
    color: #ccc;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.modal-body li {
    margin-bottom: 6px;
    color: #ccc;
}

.modal-body a {
    color: #0ea5e9;
    text-decoration: none;
}

.modal-close {
    color: #888;
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .container {
        display: grid;
        grid-template-columns: 380px 1fr;
        grid-template-rows: auto 1fr;
        height: calc(100vh - 50px);
    }

    .search-bar {
        grid-column: 1 / -1;
        padding: 16px;
        gap: 12px;
        flex-direction: row;
        align-items: end;
    }

    .search-compact {
        flex-direction: row;
        flex: 0 0 auto;
        max-width: 800px;
    }

    .search-compact input[type="text"] {
        width: 250px;
        padding: 12px;
    }

    .input-with-info {
        width: 250px;
    }

    .input-with-info input {
        width: 100%;
    }

    .info-tooltip {
        left: 0;
        right: auto;
        width: 350px;
    }

    .search-row-compact {
        width: auto;
        display: flex;
        gap: 8px;
    }

    .search-row-compact input {
        width: 110px;
        padding: 12px;
        font-size: 14px;
    }

    .search-row-compact select {
        width: 90px;
        padding: 12px;
        font-size: 14px;
    }

    .search-actions-compact {
        flex-direction: row;
        flex: 0 0 auto;
    }

    .search-actions-compact button {
        padding: 12px 24px;
        font-size: 14px;
        width: auto;
    }

    /* Hide mobile progress */
    .progress-info-mobile {
        display: none !important;
    }

    /* Show desktop results panel */
    .results-panel {
        display: flex;
        flex-direction: column;
        background: #1e1e1e;
        overflow-y: auto;
        border-right: 1px solid #2a2a2a;
    }

    .results-panel::-webkit-scrollbar {
        width: 8px;
    }

    .results-panel::-webkit-scrollbar-track {
        background: #1a1a1a;
    }

    .results-panel::-webkit-scrollbar-thumb {
        background: #3a3a3a;
        border-radius: 4px;
    }

    .results-header {
        background: #242424;
        padding: 16px;
        border-bottom: 1px solid #2a2a2a;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .results-count {
        font-weight: 700;
        color: #e0e0e0;
        margin-bottom: 12px;
        font-size: 15px;
    }

    .progress-info {
        background: rgba(14, 165, 233, 0.1);
        padding: 12px;
        border-radius: 6px;
        margin-bottom: 12px;
        display: none;
        border: 1px solid rgba(14, 165, 233, 0.2);
    }

    .progress-info.active {
        display: block;
    }

    .progress-bar {
        width: 100%;
        height: 5px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
        margin-top: 8px;
    }

    .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
        width: 0%;
        transition: width 0.3s;
    }

    .progress-text {
        font-size: 12px;
        color: #0ea5e9;
        font-weight: 600;
        margin-bottom: 4px;
    }

    .eta-text {
        font-size: 11px;
        color: #888;
        margin-top: 4px;
    }

    .sort-control {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .sort-control label {
        font-size: 12px;
        color: #888;
        font-weight: 600;
    }

    .sort-control select {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid #3a3a3a;
        border-radius: 6px;
        font-size: 13px;
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .result-item {
        background: #242424;
        margin: 10px;
        border-radius: 8px;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.2s;
        border: 1px solid #2a2a2a;
    }

    .result-item:hover {
        border-color: #0ea5e9;
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
        transform: translateY(-2px);
    }

    .result-item.selected {
        border-color: #0ea5e9;
        box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
    }

    .result-image {
        width: 100%;
        height: 160px;
        object-fit: cover;
        background: #1a1a1a;
    }

    .result-content {
        padding: 12px;
    }

    .result-title {
        font-weight: 600;
        color: #e0e0e0;
        margin-bottom: 8px;
        font-size: 13px;
        line-height: 1.4;
    }

    .result-price {
        color: #0ea5e9;
        font-weight: 700;
        font-size: 18px;
        margin-bottom: 8px;
    }

    .result-meta {
        display: flex;
        justify-content: space-between;
        font-size: 11px;
        color: #888;
    }

    .result-location {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .result-date {
        font-style: italic;
    }

    .no-results {
        text-align: center;
        padding: 40px 20px;
        color: #666;
        font-size: 13px;
    }

    .map-container {
        grid-column: 2;
        grid-row: 2;
    }

    /* Hide mobile popup on desktop */
    .mobile-popup {
        display: none !important;
    }

    .footer {
        padding: 12px 20px;
        height: 50px;
    }

    .footer-content {
        justify-content: space-between;
        max-width: 1400px;
        margin: 0 auto;
        font-size: 12px;
    }

    .footer-links {
        gap: 16px;
    }

    .footer-links a {
        font-size: 12px;
    }

    .footer-info {
        display: block;
        color: #666;
        font-size: 12px;
    }

    .status-bar {
        top: 20px;
        padding: 12px 20px;
        font-size: 13px;
    }
}