/* Hawaii Hotel Explorer Styles - Matching HawaiiGuide.com Production */
:root {
    /* Primary colors from production site */
    --primary-color: #1C4D8E;
    --primary-dark: #0E3B7E;
    --primary-light: #4A90E2;
    --secondary-color: #829A7A;
    --accent-color: #F27A24;
    --accent-hover: #e34922;

    /* Island colors */
    --island-oahu: #F27A24;
    --island-maui: #1866B4;
    --island-kauai: #1D9771;
    --island-bigisland: #c3232f;
    --island-lanai: #8B5A2B;
    --island-molokai: #6B8E23;

    /* Neutral colors */
    --background: #fff;
    --background-alt: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #222;
    --text-secondary: #888;
    --text-muted: #999;
    --border-color: #ddd;
    --border-light: #eee;
    --featured-border: #C59853;

    /* Status colors */
    --success: #43ac6a;
    --warning: #f08a24;
    --star-color: #f5a623;

    /* Shadows and effects */
    --shadow: 0 2px 5px rgba(46, 61, 73, 0.15);
    --shadow-hover: 0 5px 15px rgba(46, 61, 73, 0.25);
    --radius: 20px;
    --radius-sm: 10px;
    --radius-pill: 50px;
}

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

body {
    font-family: 'Proxima', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 16px;
}

.hotel-explorer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.explorer-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--border-color);
}

.explorer-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 8px;
    font-family: 'brother-1816-printed', 'Proxima', sans-serif;
}

.explorer-header .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Filters */
.filters-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    color: var(--text-primary);
}

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

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(28, 77, 142, 0.1);
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.filter-group label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    font-weight: 600;
    text-transform: none;
}

.search-box {
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    background: rgba(45, 40, 50, 0.05);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

#results-count {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.clear-btn {
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease-in-out;
    font-weight: 600;
}

.clear-btn:hover {
    background: rgba(28, 77, 142, 0.05);
    border-color: var(--primary-color);
    color: var(--accent-hover);
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--background-alt);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.view-btn:hover {
    color: var(--primary-color);
    background: rgba(28, 77, 142, 0.05);
}

.view-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-btn svg {
    flex-shrink: 0;
}

/* Map View */
.hotels-map {
    height: 600px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-hover) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

.leaflet-popup-close-button {
    color: white !important;
    font-size: 20px !important;
    padding: 8px 10px !important;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.map-popup {
    font-family: 'Proxima', -apple-system, BlinkMacSystemFont, sans-serif;
}

.map-popup-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.map-popup-no-image {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.map-popup-content {
    padding: 14px;
}

.map-popup-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.map-popup-area {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.map-popup-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.map-popup-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-popup-rating .stars {
    color: var(--star-color);
    font-size: 0.9rem;
    letter-spacing: -1px;
}

.map-popup-rating .score {
    font-weight: 700;
    font-size: 0.9rem;
}

.map-popup-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.map-popup-badge.beachfront {
    background: var(--star-color);
}

.map-popup-badge.type {
    background: var(--secondary-color);
}

.map-popup-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--accent-color);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
}

.map-popup-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* Custom marker clusters */
.hotel-marker {
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.hotel-marker.beachfront {
    background: var(--star-color);
}

/* Hotels Grid */
.hotels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Hotel Card */
.hotel-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease-in-out;
    border: 1px solid var(--border-light);
}

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

.hotel-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    overflow: hidden;
}

.hotel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hotel-card:hover .hotel-image img {
    transform: scale(1.05);
}

.hotel-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    font-size: 3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hotel-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    text-shadow: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.badge.beachfront {
    background: var(--star-color);
    color: white;
}

/* Island-specific badge colors */
.badge.island {
    color: white;
}

.badge.island[data-island="Oahu"] {
    background: var(--island-oahu);
}

.badge.island[data-island="Maui"] {
    background: var(--island-maui);
}

.badge.island[data-island="Kauai"] {
    background: var(--island-kauai);
}

.badge.island[data-island="Big Island"] {
    background: var(--island-bigisland);
}

.badge.island[data-island="Lanai"] {
    background: var(--island-lanai);
}

.badge.island[data-island="Molokai"] {
    background: var(--island-molokai);
}

.hotel-content {
    padding: 16px 18px;
}

.hotel-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.3;
}

.hotel-name:hover {
    color: var(--primary-color);
}

.hotel-area {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.hotel-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating .stars {
    color: var(--star-color);
    font-size: 1rem;
    letter-spacing: -2px;
}

.rating .score {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.rating .reviews {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.price-level {
    color: var(--success);
    font-weight: 700;
    font-size: 1rem;
}

.hotel-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--background-alt);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
}

.hotel-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hotel-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    min-height: 28px;
}

.amenity {
    padding: 4px 10px;
    background: rgba(130, 154, 122, 0.15);
    color: var(--secondary-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hotel-actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    opacity: 0.9;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(28, 77, 142, 0.05);
    color: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    background: var(--background-alt);
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
}

.no-results p {
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hotel-explorer {
        padding: 12px;
    }

    .explorer-header h1 {
        font-size: 1.6rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .results-info {
        flex-wrap: wrap;
        gap: 12px;
    }

    .view-toggle {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .hotels-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hotels-map {
        height: 450px;
    }

    .hotel-image {
        height: 180px;
    }

    .hotel-actions {
        flex-direction: column;
        gap: 8px;
    }

    .leaflet-popup-content {
        width: 250px !important;
    }
}

/* Iframe-friendly adjustments */
@media (max-height: 600px) {
    .explorer-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .explorer-header h1 {
        font-size: 1.25rem;
    }

    .explorer-header .subtitle {
        display: none;
    }
}

/* Footer / Google Attribution */
.explorer-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.google-attribution {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--background-alt);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.google-logo {
    height: 18px;
    width: auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding: 20px;
}

.page-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.page-btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

#page-info {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Proxima', -apple-system, BlinkMacSystemFont, sans-serif;
}

.chat-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(28, 77, 142, 0.4);
    transition: all 0.3s ease-in-out;
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(28, 77, 142, 0.5);
}

.chat-toggle svg {
    flex-shrink: 0;
}

.chat-panel {
    display: none;
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 360px;
    max-height: 500px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-direction: column;
}

.chat-panel.open {
    display: flex;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    font-weight: 700;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    min-height: 200px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.chat-message.user .message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-content {
    background: var(--background-alt);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.assistant .message-content a {
    color: var(--primary-color);
    font-weight: 600;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    background: white;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--primary-color);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.chat-send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--background-alt);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Chat widget responsive */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 10px;
        right: 10px;
    }

    .chat-toggle-text {
        display: none;
    }

    .chat-toggle {
        padding: 14px;
        border-radius: 50%;
    }

    .chat-panel {
        width: calc(100vw - 20px);
        max-width: 360px;
        bottom: 70px;
        right: 0;
    }
}

/* Print styles */
@media print {
    .hotel-explorer {
        max-width: none;
    }

    .filters-container,
    .clear-btn,
    .chat-widget,
    .pagination {
        display: none;
    }

    .hotel-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
