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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    height: 100vh;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.chat-header {
    padding: 16px 20px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chat-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.chat-header .subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
    flex: 1;
}

.btn-reset {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.25);
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message-user {
    align-self: flex-end;
    background: #1a1a2e;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-bot {
    align-self: flex-start;
    background: #f0f0f0;
    border-bottom-left-radius: 4px;
}

.message-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-style: italic;
}

.message-error {
    color: #d32f2f;
    background: #ffebee;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #d32f2f;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.restaurants-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.restaurants-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.restaurant-card {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.restaurant-card:hover {
    border-color: #1a1a2e;
    background: #f8f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.restaurant-name {
    font-weight: 600;
    font-size: 1rem;
}

.restaurant-url {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
    word-break: break-all;
}

.restaurant-desc {
    font-size: 0.85rem;
    color: #555;
    margin-top: 4px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    background: #e0e0e0;
    margin-top: 6px;
    margin-right: 4px;
}

.badge-green {
    background: #c8e6c9;
    color: #2e7d32;
}

.badge-blue {
    background: #bbdefb;
    color: #1565c0;
}

.internet-search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px dashed #1a1a2e;
    background: #f8f8ff;
    padding: 14px;
}

.internet-search-btn:hover {
    background: #eef;
    border-color: #1a1a2e;
}

.internet-search-icon {
    font-size: 1.2rem;
}

.restaurant-domain {
    font-size: 0.8rem;
    color: #1565c0;
    margin-top: 2px;
}

.preferences-question {
    background: #f0f4ff;
    border-radius: 10px;
    padding: 14px;
    border-left: 3px solid #1a1a2e;
}

.preferences-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.preferences-hint {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.recommendations {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recommendation-set {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    background: #fafafa;
}

.recommendation-set h3 {
    color: #1a1a2e;
    margin-bottom: 6px;
}

.set-summary {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.dish-card {
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #eee;
}

.dish-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dish-name {
    font-weight: 600;
}

.dish-kbdu {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.kbdu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

.kbdu-label {
    color: #999;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.kbdu-value {
    font-weight: 600;
    color: #1a1a2e;
}

.dish-portion {
    font-size: 0.8rem;
    color: #888;
}

.dish-why {
    font-size: 0.85rem;
    color: #555;
    margin-top: 4px;
    font-style: italic;
}

.set-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.input-area {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.input-attachments {
    display: flex;
    gap: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.image-preview {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden-file-input {
    display: none;
}

.btn-attach {
    padding: 10px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-attach:hover:not(:disabled) {
    background: #f0f0f0;
    color: #1a1a2e;
    border-color: #1a1a2e;
}

.btn-attach:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-form {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}

.chat-input:focus {
    border-color: #1a1a2e;
}

.btn-send {
    padding: 10px 20px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-send:hover:not(:disabled) {
    background: #2d2d4e;
}

@media (max-width: 600px) {
    .chat-container {
        max-width: 100%;
    }
    .message {
        max-width: 95%;
    }
}
