/* Modern Design System - Hotel Price Tracker */
/* Consistent with flightWebsite design */

:root {
    /* Primary Colors */
    --color-primary: #0066FF;
    --color-primary-hover: #0052CC;
    --color-primary-light: #E6F0FF;

    /* Success/Secondary */
    --color-success: #00875A;
    --color-success-hover: #006644;
    --color-success-light: #E3FCEF;

    /* Neutrals */
    --color-bg: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #5C5C5C;
    --color-text-muted: #8C8C8C;
    --color-border: #E0E0E0;
    --color-border-light: #F0F0F0;

    /* Feedback Colors */
    --color-error: #DE350B;
    --color-error-light: #FFEBE6;
    --color-warning: #FF991F;
    --color-warning-light: #FFFAE6;

    /* Rating Colors */
    --color-rating-high: #00875A;
    --color-rating-medium: #FF991F;
    --color-rating-low: #DE350B;

    /* Design Tokens */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-focus: 0 0 0 3px rgba(0, 102, 255, 0.15);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;

    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    min-height: 100vh;
    margin: 0;
    padding: var(--space-lg) var(--space-md);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
}

.form-card,
.hero-section {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: var(--space-xl) 0 var(--space-lg);
}

.hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-md);
    background: var(--color-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.hero-section h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-sm);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin: 0;
}

/* Form Card */
.form-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
}

.form-card form {
    position: relative;
}

/* Form Sections */
.form-section {
    margin-bottom: var(--space-md);
}

.form-group {
    position: relative;
}

/* Input with Icon */
.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    z-index: 1;
}

.input-icon-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 var(--space-md) 0 48px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    transition: var(--transition-fast);
}

.input-icon-wrapper input:hover {
    border-color: #C0C0C0;
}

.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.input-icon-wrapper input:focus + .input-icon,
.input-icon-wrapper input:not(:placeholder-shown) + .input-icon {
    color: var(--color-primary);
}

.input-icon-wrapper input::placeholder {
    color: var(--color-text-muted);
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    margin-top: var(--space-xs);
}

.autocomplete-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: var(--transition-fast);
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--color-primary-light);
}

/* Options Row (Adults, Rooms, Currency) */
.options-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
}

.form-group.compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group.compact label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group.compact select,
.form-group.compact input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-sm);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    text-align: center;
    transition: var(--transition-fast);
    cursor: pointer;
}

.form-group.compact select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238C8C8C' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.form-group.compact select:hover,
.form-group.compact input:hover {
    border-color: #C0C0C0;
}

.form-group.compact select:focus,
.form-group.compact input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

#currency {
    text-transform: uppercase;
}

/* Sticky Bottom Bar */
.sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: var(--space-md) var(--space-lg);
    padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sticky-bar.visible {
    transform: translateY(0);
}

.sticky-bar-count {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
    text-align: center;
}

.sticky-bar-row {
    display: flex;
    gap: var(--space-sm);
    max-width: 560px;
    margin: 0 auto;
}

.sticky-bar-row input[type="email"] {
    flex: 1;
    padding: var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    transition: var(--transition-fast);
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}

.sticky-bar-row input[type="email"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.sticky-bar-row .btn-success-action {
    margin-top: 0;
    width: auto;
    padding: var(--space-md) var(--space-lg);
    white-space: nowrap;
    flex-shrink: 0;
}

.sticky-bar-hint {
    font-size: var(--font-size-xs);
    color: var(--color-success);
    text-align: center;
    margin-top: var(--space-sm);
}

@media (max-width: 480px) {
    .sticky-bar-row {
        flex-direction: column;
    }

    .sticky-bar-row .btn-success-action {
        width: 100%;
    }
}

/* Buttons */
.btn-primary-action,
.btn-success-action {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary-action {
    background: var(--color-primary);
    color: white;
    margin-top: var(--space-md);
}

.btn-primary-action:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary-action:active {
    transform: translateY(0);
}

.btn-success-action {
    background: var(--color-success);
    color: white;
    margin-top: var(--space-md);
}

.btn-success-action:hover {
    background: var(--color-success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success-action:active {
    transform: translateY(0);
}

/* Submit Text */
#submitText {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: var(--space-md);
}

/* Loader */
.loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 0.8s linear infinite;
    z-index: 100;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Messages */
.message-box {
    max-width: 480px;
    margin: var(--space-md) auto;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.message-box.error {
    background: var(--color-error-light);
    border: 1px solid #FFCCC7;
    color: var(--color-error);
}

.message-box p {
    margin: 0;
    font-size: var(--font-size-sm);
}

/* Results Box */
#resultsBox {
    margin-top: var(--space-xl);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

@media (max-width: 600px) {
    #resultsBox {
        grid-template-columns: 1fr;
    }
}

/* Hotel Cards */
.card {
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card.card-no-photo {
    background: linear-gradient(135deg, #1a2a4a, #2d4a7a);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.hiddenHotelId {
    display: none;
}

/* Full-bleed overlay */
.card-overlay {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 1;
    padding: var(--space-md);
    background: linear-gradient(to bottom, transparent 25%, rgba(0, 0, 0, 0.75) 100%);
    position: relative;
    gap: var(--space-xs);
}

/* Hotel name */
.card-header {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: #fff;
    background: none;
    padding: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.badges {
    display: flex;
    flex-direction: row;
    gap: var(--space-xs);
    align-items: center;
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
}

.badge {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
}

.badge.distance {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    backdrop-filter: blur(4px);
}

.badge.rating {
    color: white;
}

.badge.rating.rating-high {
    background: var(--color-rating-high);
}

.badge.rating.rating-medium {
    background: var(--color-rating-medium);
}

.badge.rating.rating-low {
    background: var(--color-rating-low);
}

.prices {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-per-night {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
}

.price-per-night .amount {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #fff;
}

.price-per-night .label {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
}

.total-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
}

.total-price .amount {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.total-price .label {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
}

/* Track Button */
.select-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.track-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    background: transparent;
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: var(--space-xs);
}

.track-button:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.track-button .tracking-text {
    display: none;
}

.track-button .track-text {
    display: inline;
}

.select-checkbox:checked + .track-button {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.select-checkbox:checked + .track-button:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.select-checkbox:checked + .track-button .track-text {
    display: none;
}

.select-checkbox:checked + .track-button .tracking-text {
    display: inline;
}

.select-checkbox:checked + .track-button .tracking-text::before {
    content: '\2713';
    margin-right: var(--space-sm);
}

/* Modal Styles */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    max-width: 400px;
    margin: var(--space-lg) auto;
    padding: var(--space-md);
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl) var(--space-lg) var(--space-md);
    border: none;
    position: relative;
}

.modal-header .btn-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    opacity: 0.5;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.modal-icon.success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.modal-body {
    padding: var(--space-md) var(--space-lg);
    text-align: center;
}

.modal-body p {
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    border: none;
    justify-content: center;
}

.modal-footer .btn {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    font-family: inherit;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-footer .btn-primary {
    background: var(--color-primary);
    border: none;
    color: white;
}

.modal-footer .btn-primary:hover {
    background: var(--color-primary-hover);
}

.modal-footer .btn-secondary {
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text-secondary);
}

.modal-footer .btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

/* Flatpickr Customization */
.flatpickr-calendar {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    border: 1px solid var(--color-border-light) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.flatpickr-day.inRange {
    background: var(--color-primary-light) !important;
    border-color: var(--color-primary-light) !important;
    box-shadow: none !important;
}

.flatpickr-day:hover {
    background: var(--color-primary-light) !important;
    border-color: var(--color-primary-light) !important;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: var(--space-md) var(--space-sm);
    }

    .hero-section {
        padding: var(--space-lg) 0 var(--space-md);
    }

    .hero-icon {
        width: 60px;
        height: 60px;
    }

    .hero-icon svg {
        width: 32px;
        height: 32px;
    }

    .hero-section h1 {
        font-size: var(--font-size-xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    .form-card {
        padding: var(--space-md);
    }

    .options-row {
        gap: var(--space-xs);
    }

    .form-group.compact select,
    .form-group.compact input {
        height: 40px;
        font-size: var(--font-size-xs);
    }

    .card {
        min-height: 220px;
    }

    .card-header {
        font-size: var(--font-size-xl);
    }

    .badge {
        padding: 3px 6px;
        font-size: var(--font-size-xs);
    }
}

/* Selection styling */
::selection {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
