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

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: clamp(4px, 2vw, 16px);
    line-height: 1.4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: clamp(8px, 2vw, 14px);
    padding: clamp(12px, 3vw, 20px);
    box-shadow: 0 6px 24px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    min-height: calc(100vh - clamp(8px, 4vw, 32px));
    position: relative;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: clamp(2px, 3vw, 0px);
    color: white;
    padding: clamp(8px, 2vw, 16px) 0;
}

.header h1 {
    font-size: clamp(1.3em, 5vw, 1.8em);
    margin-bottom: clamp(4px, 1vw, 8px);
    text-shadow: 1.5px 1.5px 3px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.header p {
    font-size: clamp(0.8em, 3vw, 1em);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.main-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(16px, 4vw, 45px);
    flex-wrap: wrap;
    min-height: clamp(400px, 60vh, 598px);
    width: 100%;
}

/* Force column layout on smaller screens */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        align-items: stretch;
    }
}

.left-section {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vw, 12px);
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* Desktop specific styles */
@media (min-width: 1025px) {
    .left-section {
        min-width: clamp(280px, 90vw, 400px);
        max-width: 400px;
    }
}

.restaurant-list {
    background: rgba(255, 255, 255, 0.9);
    border-radius: clamp(8px, 2vw, 14px);
    padding: clamp(12px, 3vw, 16px);
    overflow-y: auto;
    height: fit-content;
    max-height: clamp(300px, 40vh, 400px);
    -webkit-overflow-scrolling: touch;
}

.restaurant-list h2 {
    color: #333;
    margin-bottom: clamp(8px, 2vw, 14px);
    font-size: clamp(1.1em, 4vw, 1.4em);
    font-weight: 600;
}

.restaurant-card {
    background: white;
    border-radius: clamp(8px, 2vw, 12px);
    padding: clamp(8px, 2vw, 6px);
    margin: clamp(6px, 1.5vw, 0px) 0;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.restaurant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.restaurant-card:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.restaurant-card.active {
    border-color: #4267B2;
    background: #f0f2f5;
    box-shadow: 0 4px 16px rgba(66, 103, 178, 0.2);
}

.restaurant-card-header {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 14px);
    flex-wrap: nowrap;
}

.restaurant-avatar {
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.restaurant-info {
    flex: 1;
    min-width: 0;
}

.restaurant-info h3 {
    color: #333;
    font-size: clamp(1em, 3vw, 0.9em);
    margin-bottom: clamp(2px, 1vw, 4px);
    word-wrap: break-word;
    font-weight: 600;
    line-height: 1.3;
}

.restaurant-info p {
    color: #666;
    font-size: clamp(0.8em, 2.5vw, 0.7em);
    word-wrap: break-word;
    line-height: 1.4;
}

.info-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: clamp(8px, 2vw, 12px);
    padding: clamp(12px, 3vw, 16px);
    display: none;
    overflow-y: auto;
    max-height: clamp(250px, 35vh, 300px);
    -webkit-overflow-scrolling: touch;
    position: relative;
}

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

.info-section h3 {
    color: #333;
    margin-bottom: clamp(8px, 2vw, 10px);
    font-size: clamp(1em, 3vw, 1.1em);
    font-weight: 600;
    padding-right: 24px;
}

.info-details {
    color: #555;
    line-height: 1.6;
    font-size: clamp(0.85em, 2.5vw, 0.5em);
}

.info-details strong {
    color: #333;
    font-weight: 600;
}

.close-info {
    position: absolute;
    top: clamp(6px, 1.5vw, 8px);
    right: clamp(8px, 2vw, 12px);
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: clamp(24px, 5vw, 28px);
    height: clamp(24px, 5vw, 28px);
    font-size: clamp(0.9em, 2.5vw, 1.2em);
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-info:hover {
    background: #e0e0e0;
    color: #333;
}

.chatbox {
    display: none;
    flex-direction: column;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
    border-radius: clamp(8px, 2vw, 12px);
    overflow: hidden;
}

/* Desktop specific styles */
@media (min-width: 1025px) {
    .chatbox {
        min-width: clamp(300px, 90vw, 670px);
        max-width: 670px;
    }
}

.chatbox.active {
    display: flex;
    height: 555px;
}

.chat-header {
    background: #4267B2;
    color: white;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    flex-shrink: 0;
    min-height: clamp(48px, 8vh, 60px);
}

.chat-avatar {
    width: clamp(28px, 6vw, 32px);
    height: clamp(28px, 6vw, 32px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-title {
    font-size: clamp(0.9em, 2.8vw, 1em);
    font-weight: 600;
    word-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.chat-status {
    font-size: clamp(0.7em, 2.2vw, 0.75em);
    opacity: 0.9;
}

.chat-messages {
    padding: clamp(8px, 2vw, 14px);
    overflow-y: auto;
    background: #f8f9fa;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.message {
    margin-bottom: clamp(8px, 2vw, 12px);
    display: flex;
    align-items: flex-start;
    gap: clamp(6px, 1.5vw, 8px);
    max-width: 100%;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: clamp(24px, 5vw, 28px);
    height: clamp(24px, 5vw, 28px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
}

.message-content {
    background: white;
    padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 12px);
    border-radius: clamp(12px, 3vw, 16px);
    max-width: clamp(250px, 75vw, 70%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    text-align: left;
    word-wrap: break-word;
    font-size: clamp(0.8em, 2.5vw, 0.9em);
    line-height: 1.4;
    position: relative;
}

.message.user .message-content {
    background: #4267B2;
    color: white;
}

.quick-questions {
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
    background: white;
    border-top: 1px solid #e4e6ea;
    flex-shrink: 0;
}

.quick-questions h4 {
    margin-bottom: clamp(6px, 1.5vw, 8px);
    color: #333;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    font-weight: 600;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 25vw, 140px), 1fr));
    gap: clamp(4px, 1vw, 6px);
    width: 100%;
}

.question-btn {
    background: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: clamp(12px, 3vw, 16px);
    padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 12px);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.7em, 2.2vw, 0.8em);
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: clamp(32px, 6vw, 36px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-btn:hover {
    background: #e4e6ea;
    transform: translateY(-1px);
}

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

.chat-input {
    display: flex;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
    background: white;
    border-top: 1px solid #e4e6ea;
    flex-shrink: 0;
    gap: clamp(6px, 1.5vw, 8px);
    align-items: center;
}

.chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: clamp(12px, 3vw, 16px);
    padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 12px);
    outline: none;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    min-width: 0;
    min-height: clamp(32px, 6vw, 36px);
    transition: border-color 0.2s ease;
}

.chat-input input:focus {
    border-color: #4267B2;
}

.chat-input button {
    background: #4267B2;
    color: white;
    border: none;
    border-radius: 50%;
    width: clamp(32px, 6vw, 36px);
    height: clamp(32px, 6vw, 36px);
    cursor: pointer;
    font-size: clamp(0.9em, 2.5vw, 1em);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-input button:hover {
    background: #365899;
    transform: scale(1.05);
}

.chat-input button:active {
    transform: scale(0.95);
}

.cta-button {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: clamp(10px, 2.5vw, 14px) clamp(20px, 5vw, 36px);
    font-size: clamp(0.85rem, 2.8vw, 1rem);
    font-weight: 600;
    border: none;
    border-radius: clamp(20px, 5vw, 40px);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
    white-space: nowrap;
    min-height: clamp(40px, 8vw, 48px);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.4);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-wrapper {
    display: flex;
    justify-content: center;
}

.features-title {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    color: white;
    margin-bottom: clamp(16px, 4vw, 20px);
    margin-top: clamp(8px, 2vw, 10px);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 10px);
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 80vw, 280px), 1fr));
    gap: clamp(12px, 3vw, 20px);
    margin-top: clamp(16px, 4vw, 24px);
    width: 100%;
}

.feature-card {
    background: rgba(255, 255, 255, 0.12);
    border-radius: clamp(12px, 3vw, 16px);
    padding: clamp(16px, 4vw, 28px) clamp(12px, 3vw, 24px);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.feature-icon {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    margin-bottom: clamp(12px, 3vw, 16px);
    display: block;
}

.feature-title {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    color: white;
    margin-bottom: clamp(8px, 2vw, 12px);
    font-weight: 600;
}

.feature-description {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    font-size: clamp(0.8rem, 2.8vw, 0.95rem);
}

.sparkle {
    color: #feca57;
}

.hidden {
    display: none !important;
}

.unhide-button {
    position: absolute;
    top: 20px;
    left: 20px;
    display: none;
    z-index: 9999;
    padding: 8px 16px;
    font-size: 14px;
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
}

#unhide-button {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 9999;
    display: none;
}

.message-content ul,
.message-content ol {
    margin: 0.5em 0;
    padding-left: 1.2em;
}

.message-content li {
    margin-bottom: 0.3em;
    line-height: 1.4;
}

.message-content strong {
    font-weight: 600;
}

/* Enhanced Mobile Optimizations */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: clamp(8px, 2vw, 16px);
    }

    .main-content {
        flex-direction: column;
        align-items: stretch;
        gap: clamp(12px, 3vw, 20px);
    }

    .left-section {
        width: 100%;
        max-width: none;
        min-width: 0;
        order: 1;
    }

    .chatbox {
        width: 100%;
        max-width: none;
        min-width: 0;
        order: 2;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: clamp(4px, 1vw, 8px);
    }

    .container {
        min-height: calc(100vh - clamp(8px, 2vw, 16px));
        padding: clamp(8px, 2vw, 12px);
        border-radius: clamp(6px, 1.5vw, 10px);
    }

    .main-content {
        flex-direction: column;
        align-items: stretch;
        gap: clamp(8px, 2vw, 16px);
        min-height: auto;
    }

    .left-section {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .chatbox {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .chatbox.active {
        height: clamp(400px, 55vh, 500px);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: clamp(8px, 2vw, 16px);
    }

    .question-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: clamp(4px, 1vw, 6px);
    }

    .restaurant-card-header {
        gap: clamp(8px, 2vw, 12px);
    }

    .restaurant-list {
        max-height: clamp(270px, 30vh, 300px);
    }

    .message-content {
        max-width: clamp(200px, 80vw, 85%);
    }

    #unhide-button {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .question-grid {
        grid-template-columns: 1fr 1fr;
        gap: clamp(4px, 1vw, 6px);
    }

    .question-btn {
        white-space: normal;
        text-overflow: unset;
        overflow: visible;
        padding: clamp(6px, 1.5vw, 8px) clamp(6px, 1.5vw, 8px);
        min-height: clamp(36px, 8vw, 42px);
        font-size: clamp(0.7em, 2.5vw, 0.8em);
    }

    .chat-input {
        gap: clamp(4px, 1vw, 6px);
    }

    .chatbox.active {
        height: clamp(350px, 50vh, 450px);
    }

    .restaurant-card-header {
        flex-direction: row;
        text-align: center;
        gap: clamp(6px, 1.5vw, 8px);
    }

    .restaurant-info {
        text-align: center;
    }

    .message-content {
        max-width: clamp(180px, 85vw, 90%);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    #unhide-button {
        display: none !important;
    }
    .chat-messages {
        min-height: 300px;
    }
}

@media (max-width: 360px) {
    .question-grid {
        grid-template-columns: 1fr;
    }

    .chat-input {
        flex-direction: column;
        gap: clamp(6px, 1.5vw, 8px);
        align-items: stretch;
    }

    .chat-input input {
        margin-bottom: clamp(4px, 1vw, 6px);
    }

    .chat-input button {
        width: 100%;
        border-radius: clamp(6px, 1.5vw, 8px);
        height: clamp(36px, 8vw, 40px);
    }

    .message-content {
        max-width: clamp(160px, 90vw, 95%);
    }

    .restaurant-list {
        max-height: clamp(200px, 25vh, 250px);
    }

    .chatbox.active {
        height: clamp(300px, 45vh, 400px);
    }

}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    .restaurant-card {
        min-height: 44px;
    }

    .question-btn {
        min-height: 44px;
    }

    .chat-input button {
        min-width: 44px;
        min-height: 44px;
    }

    .close-info {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Improve scrolling on mobile */
@supports (-webkit-overflow-scrolling: touch) {

    .chat-messages,
    .restaurant-list,
    .info-section {
        -webkit-overflow-scrolling: touch;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}