:root {
    --bg: #0d0d0d;
    --bg-soft: #141414;
    --bg-elevated: #1a1a1a;
    --bg-input: #212121;
    --text: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-light: rgba(217, 119, 6, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --success: #22c55e;
    --star: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --transition: 0.2s ease;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 13, 13, 0.75);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.logo__icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.logo__icon svg {
    width: 100%;
    height: 100%;
}

.header__actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header__logout {
    display: inline-flex;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.btn--ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.btn--ghost:hover {
    color: var(--text);
    border-color: var(--text-tertiary);
    background: var(--bg-elevated);
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--accent-hover);
}

/* Chat */
.chat {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px 140px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.chat__welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    gap: 20px;
    animation: fadeIn 0.6s ease;
}

.welcome__logo {
    width: 56px;
    height: 56px;
    color: var(--accent);
    margin-bottom: 8px;
}

.welcome__title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    max-width: 560px;
}

.welcome__title span {
    color: var(--accent);
}

.welcome__subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 480px;
}

/* Input */
.input-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: linear-gradient(to top, var(--bg) 60%, transparent);
    padding: 20px;
}

.input-panel__inner {
    max-width: 760px;
    margin: 0 auto;
}

.ai-input {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 6px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.ai-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-md);
}

.ai-input__field {
    width: 100%;
    min-height: 56px;
    max-height: 200px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    padding: 14px 18px;
    resize: none;
    font-family: inherit;
}

.ai-input__field::placeholder {
    color: var(--text-tertiary);
}

.ai-input__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 8px;
}

.ai-input__hint {
    font-size: 12px;
    color: var(--text-tertiary);
    padding-left: 10px;
}

.ai-input__send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.ai-input__send:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.ai-input__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-input__send svg {
    width: 18px;
    height: 18px;
}

/* Suggestions */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    max-width: 700px;
}

.suggestion {
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.suggestion:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-light);
}

/* Messages */
.message {
    display: flex;
    gap: 14px;
    animation: fadeIn 0.4s ease;
}

.message__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.message--user .message__avatar {
    background: var(--accent);
    color: #fff;
}

.message--ai .message__avatar {
    background: var(--bg-elevated);
    color: var(--accent);
    border: 1px solid var(--border);
}

.message__content {
    flex: 1;
    padding-top: 4px;
}

.message__author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.message__text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
}

.message--ai .message__text {
    color: var(--text);
}

/* Typing */
.typing {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 24px;
}

.typing__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: typing 1.4s ease-in-out infinite;
}

.typing__dot:nth-child(2) { animation-delay: 0.2s; }
.typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Results carousel */
.results {
    margin-top: 12px;
}

.results__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.results__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.results__count {
    font-size: 13px;
    color: var(--text-tertiary);
}

.carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.carousel::-webkit-scrollbar {
    height: 6px;
}

.carousel::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

.carousel__card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.carousel__card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.carousel__image {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.carousel__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.carousel__favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: var(--transition);
}

.carousel__favorite:hover {
    background: rgba(217, 119, 6, 0.9);
}

.carousel__favorite svg {
    width: 14px;
    height: 14px;
}

.carousel__content {
    padding: 14px;
}

.carousel__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.carousel__rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text);
    font-weight: 600;
}

.carousel__rating svg {
    width: 12px;
    height: 12px;
    color: var(--star);
    fill: currentColor;
}

.carousel__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.carousel__location {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.carousel__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.carousel__tag {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.carousel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.carousel__price {
    font-size: 17px;
    font-weight: 700;
}

.carousel__price span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.carousel__type {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal drawer */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 200;
}

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

.modal-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    max-width: 640px;
    min-width: 320px;
    height: 100%;
    background: var(--bg-soft);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
    z-index: 210;
    display: flex;
    flex-direction: column;
    visibility: hidden;
}

.modal-drawer.active {
    transform: translateX(0);
    visibility: visible;
}

.modal-drawer__header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-drawer__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-drawer__close:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.modal-drawer__close svg {
    width: 20px;
    height: 20px;
}

.modal-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 40px;
}

.modal-drawer__placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    text-align: center;
}

.modal-detail__image {
    height: 300px;
    margin: 0 0 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.modal-detail__badge {
    position: absolute;
    top: 16px;
    left: 20px;
    background: rgba(0, 0, 0, 0.45);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 13px;
    color: #fff;
}

.modal-detail__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.25;
}

.modal-detail__location {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.modal-detail__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-detail__meta-item strong {
    color: var(--text);
    font-weight: 600;
}

.modal-detail__price {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-detail__price span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.modal-detail__option {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-detail__section {
    margin-bottom: 24px;
}

.modal-detail__section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.modal-detail__text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.modal-detail__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-detail__tag {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.modal-detail__actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.modal-detail__actions .btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
}

.modal-detail__actions .btn.active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.modal-detail__gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin: 0 -20px 24px;
    padding: 0 20px;
    scrollbar-width: thin;
}

.modal-detail__gallery-thumb {
    width: 120px;
    height: 84px;
    border-radius: var(--radius-md);
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.modal-detail__gallery-thumb:hover {
    border-color: var(--accent);
}

.modal-detail__params {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modal-detail__param {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.modal-detail__param span {
    color: var(--text-tertiary);
}

.modal-detail__param strong {
    color: var(--text);
    font-weight: 600;
}

.modal-detail__video video {
    width: 100%;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
}

.modal-detail__address {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-detail__map {
    height: 260px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.modal-detail__booking-form {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.modal-detail__booking-form.hidden {
    display: none;
}

.booking-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.booking-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.booking-fields input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--text);
    font-size: 14px;
}

/* Results grid on mobile */
@media (max-width: 640px) {
    .modal-drawer {
        max-width: 100%;
        border-radius: 0;
    }

    .modal-detail__image {
        height: 240px;
        border-radius: var(--radius-md);
    }

    .header__actions .btn--ghost {
        display: none;
    }

    .carousel {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        overflow-x: visible;
        padding-bottom: 0;
        scroll-snap-type: none;
    }

    .carousel__card {
        flex: none;
        width: 100%;
    }

    .chat {
        padding-bottom: 160px;
    }

    .modal-drawer {
        width: 100%;
        max-width: none;
        min-width: auto;
    }

    .modal-detail__image {
        height: 180px;
    }

    .modal-detail__title {
        font-size: 22px;
    }
}
