        :root {
            --primary-color: #722F37;
            --secondary-color: #A4303F;
            --light-color: #F9F7F3;
            --dark-color: #2C1A1D;
            --accent-color: #D8B4A0;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
            height: 100vh;
            color: var(--dark-color);
        }
        
        .container {
            max-width: 100%;
            height: 100vh;
            margin: 0 auto;
            display: grid;
            grid-template-rows: auto 1fr auto;
            overflow: hidden;
            background-color: var(--light-color);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            position: relative;
        }

        .powered-by {
            font-size: 0.75rem;
            text-align: center;
            margin-top: 5px;
            opacity: 0.9;
        }

        .powered-by a {
            color: white;
            text-decoration: none;
            transition: opacity 0.2s;
        }

        .powered-by a:hover {
            opacity: 0.8;
            text-decoration: underline;
        }

        .header {
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 1.2rem;
            text-align: center;
            position: relative;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .header-controls {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            gap: 0.5rem;
        }

        .header-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.3s;
            font-size: 0.9rem;
        }

        .header-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .header h1 {
            font-size: 1.5rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 0;
        }

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

        #chat-box {
            overflow-y: auto;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d8b4a0' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
        }

        .welcome-message {
            text-align: center;
            opacity: 0.7;
            margin: 1rem 0;
            font-style: italic;
            font-size: 0.9rem;
        }

        .chat-bubble {
            max-width: 85%;
            padding: 1rem;
            border-radius: 1.2rem;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            position: relative;
            animation: fadeIn 0.3s ease-in-out;
            line-height: 1.5;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .user {
            align-self: flex-end;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
            border-bottom-right-radius: 0.3rem;
        }

        .bot {
            align-self: flex-start;
            background: white;
            border-bottom-left-radius: 0.3rem;
            border-left: 4px solid var(--accent-color);
        }

        .chat-bubble::after {
            content: '';
            position: absolute;
            bottom: 0;
            width: 12px;
            height: 12px;
        }

        .user::after {
            right: -6px;
            border-radius: 0 0 0 12px;
            box-shadow: -6px 6px 0 0 var(--secondary-color);
        }

        .bot::after {
            left: -6px;
            border-radius: 0 0 12px 0;
            box-shadow: 6px 6px 0 0 white;
        }

        .typing-indicator {
            display: flex;
            gap: 4px;
            padding: 10px 15px;
            background: white;
            border-radius: 20px;
            align-self: flex-start;
            margin-top: 5px;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            background-color: var(--primary-color);
            border-radius: 50%;
            opacity: 0.6;
            animation: typingAnimation 1.4s infinite;
        }

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

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

        @keyframes typingAnimation {
            0% { transform: translateY(0px); opacity: 0.6; }
            50% { transform: translateY(-5px); opacity: 0.9; }
            100% { transform: translateY(0px); opacity: 0.6; }
        }

        .input-container {
            display: flex;
            padding: 1rem;
            background-color: white;
            border-top: 1px solid rgba(0, 0, 0, 0.1);
            position: relative;
            gap: 8px;
        }

        .terms-link {
            padding: 1rem;
            font-size: 0.7rem;
            text-align: center;
        }

        #user-input {
            flex-grow: 1;
            padding: 0.8rem 1rem;
            border: 1px solid #ddd;
            border-radius: 1.5rem;
            outline: none;
            font-size: 16px;
            transition: border 0.3s;
            min-width: 0;
        }

        #user-input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(114, 47, 55, 0.2);
        }

        #send-btn, #stop-btn {
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            border-radius: 50%;
            width: 45px;
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.2s, background 0.3s;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        #stop-btn {
            background: #dc3545;
            display: none;
        }

        #send-btn:hover, #stop-btn:hover {
            transform: scale(1.05);
        }

        #send-btn:active, #stop-btn:active {
            transform: scale(0.95);
        }

        /* Wine intro styling for streaming wine recommendations */
        .wine-intro {
            margin-bottom: 15px;
            padding: 0;
            font-size: 1rem;
            line-height: 1.5;
            color: var(--dark-color);
            font-weight: 500;
        }

        .wine-recommendation-list {
            margin-top: 10px;
        }

        /* Wine feedback buttons */
        .wine-feedback {
            margin-top: 10px;
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .feedback-btn {
            background: none;
            border: 1px solid #ddd;
            padding: 8px 12px;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .feedback-btn:hover {
            border-color: var(--primary-color);
        }

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

        /* Email prompt modal */
        .email-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            justify-content: center;
            align-items: center;
        }

        .email-modal.show {
            display: flex;
        }

        .email-modal-content {
            background: white;
            padding: 2rem;
            border-radius: 1rem;
            max-width: 400px;
            width: 90%;
            text-align: center;
        }

        .email-modal h3 {
            color: var(--primary-color);
            margin-bottom: 1rem;
        }

        .email-input {
            width: 100%;
            padding: 0.8rem;
            border: 1px solid #ddd;
            border-radius: 0.5rem;
            margin: 1rem 0;
            font-size: 16px;
        }

        .modal-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .modal-btn {
            padding: 0.8rem 1.5rem;
            border: none;
            border-radius: 0.5rem;
            cursor: pointer;
            font-size: 0.9rem;
            transition: background 0.3s;
        }

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

        .modal-btn.secondary {
            background: #f8f9fa;
            color: var(--dark-color);
            border: 1px solid #ddd;
        }

        .modal-btn:hover {
            opacity: 0.9;
        }

        /* All existing wine card styles remain the same */
        .wine-card {
            background: white;
            border-radius: 10px;
            padding: 15px;
            margin-top: 10px;
            border-left: 4px solid var(--accent-color);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .wine-card-title {
            font-weight: bold;
            color: var(--primary-color);
            margin-bottom: 5px;
        }

        .wine-card-body {
            display: flex;
            gap: 10px;
            font-size: 0.85rem;
        }

        .wine-card-image {
            width: 40px;
            height: 100px;
            background-color: var(--accent-color);
            opacity: 0.2;
            border-radius: 5px;
        }

        .wine-card-details {
            flex: 1;
        }

        .wine-card-info {
            display: flex;
            flex-wrap: wrap;
            gap: 5px 10px;
            margin-top: 5px;
        }

        .wine-card-info-item {
            font-size: 0.75rem;
            color: var(--dark-color);
            background-color: #f5f5f5;
            padding: 2px 8px;
            border-radius: 10px;
        }

        .wine-links {
            list-style-type: none;
            padding-left: 0;
        }

        .wine-link {
            display: flex;
            align-items: flex-start;
            gap: 0.75em;
            color: var(--secondary-color);
            text-decoration: none;
            padding: 12px;
            margin: 8px 0;
            background-color: rgba(212, 166, 144, 0.1);
            border-radius: 8px;
            transition: background-color 0.2s;
            position: relative;
        }

        .wine-link:hover {
            background-color: rgba(212, 166, 144, 0.2);
            text-decoration: none;
        }

        .wine-icon {
            width: 2em;
            height: 2em;
            vertical-align: middle;
            margin-right: 0.4em;
        }

        /* Wine information container */
        .wine-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        /* Wine name - prominent title */
        .wine-name {
            font-weight: bold;
            font-size: 1.1rem;
            color: var(--dark-color);
            line-height: 1.3;
            margin-bottom: 2px;
        }

        /* Wine type/grape variety */
        .wine-type {
            font-size: 0.9rem;
            color: var(--secondary-color);
            font-weight: 500;
        }

        /* Wine region */
        .wine-region {
            font-size: 0.85rem;
            color: #666;
        }

        /* Wine winery */
        .wine-winery {
            font-size: 0.8rem;
            color: #888;
            font-style: italic;
        }

        .wine-card-price {
            position: absolute;
            top: 12px;
            right: 12px;
            display: flex;
            align-items: center;
        }

        .wine-card-price-ranking {
            color: var(--secondary-color);
            font-weight: bold;
            font-size: 1rem;
        }

        /* Modal styles for wine details */
        .wine-modal {
            display: none;
            position: fixed;
            top: 0;
            right: -100%;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            transition: 0.3s all ease-in-out;
        }

        .wine-modal.show {
            display: block;
            right: 0;
        }

        .wine-modal-content {
            position: absolute;
            right: 0;
            top: 0;
            width: 80%;
            max-width: 500px;
            height: 100%;
            background-color: var(--light-color);
            padding: 20px;
            box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
            overflow-y: auto;
        }

        .close-modal {
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 28px;
            cursor: pointer;
            color: var(--primary-color);
        }

        #wine-modal-details {
            margin-top: 40px;
        }

        .wine-detail-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 20px;
        }

        .wine-detail-image {
            width: 100px;
            height: 200px;
            background-color: var(--accent-color);
            opacity: 0.3;
            border-radius: 5px;
            margin: 15px 0;
        }

        .wine-detail-info {
            line-height: 1.6;
        }

        .wine-detail-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin: 15px 0;
        }

        .wine-detail-meta span {
            background-color: #f5f5f5;
            padding: 5px 10px;
            border-radius: 15px;
            font-size: 0.85rem;
        }

        .wine-detail-price {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background-color: rgba(216, 180, 160, 0.1);
            padding: 12px 15px;
            border-radius: 8px;
            margin: 15px 0;
        }

        .price-ranking {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-weight: bold;
            color: var(--secondary-color);
            margin-left: 10px;
            font-size: 1.2rem;
        }

        @media (max-width: 767px) {
            .input-container {
                padding: 0.5rem;
            }
            #user-input {
                padding: 0.5rem 0.8rem;
                font-size: 14px;
            }
            #send-btn, #stop-btn {
                width: 40px;
                height: 40px;
            }
            .wine-modal-content {
                width: 100%;
            }
        }

        @media (min-width: 768px) {
            .container {
                max-width: 500px;
                height: 90vh;
                margin: 5vh auto;
                border-radius: 1rem;
            }
            
            .header {
                border-radius: 1rem 1rem 0 0;
            }
        }

        /* User Login */
        .user-avatar {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.9rem;
            text-transform: uppercase;
            cursor: pointer;
            transition: background 0.3s;
            border: 2px solid rgba(255, 255, 255, 0.5);
        }

        .user-avatar:hover {
            background: rgba(255, 255, 255, 0.4);
        }

        .header-btn.logged-in {
            display: none;
        }

