/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Command Section */
.command-section {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#cmd {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

#cmd:focus {
    border-color: #667eea;
}

#submitBtn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

#submitBtn:hover {
    background: #5a6fd8;
}

.quick-commands {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-cmd {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.quick-cmd:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Content Area */
.content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.stream-section {
    grid-column: 1;
}

.cart-section {
    grid-column: 2;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    height: fit-content;
}

/* Stream Container */
.stream-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.welcome-message {
    text-align: center;
    color: #666;
}

.welcome-message p {
    margin-bottom: 15px;
}

.examples {
    margin-top: 20px;
    text-align: left;
}

.examples ul {
    list-style: none;
    padding-left: 0;
}

.examples li {
    padding: 5px 0;
    color: #555;
}

.stream-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    animation: slideIn 0.3s ease;
}

.stream-message.user {
    background: #e3f2fd;
    margin-left: 20px;
}

.stream-message.assistant {
    background: #f3e5f5;
    margin-right: 20px;
}

.stream-message.error {
    background: #ffebee;
    color: #c62828;
}

.stream-message.success {
    background: #e8f5e8;
    color: #2e7d32;
}

.stream-message.info {
    background: #fff3e0;
    color: #ef6c00;
}

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

/* Results */
.results-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.results-container .card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.results-container .card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.results-container .card h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.results-container .card p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 14px;
}

.add-to-cart {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.add-to-cart:hover {
    background: #0056b3;
}

.disambiguation {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.disambiguation h4 {
    margin: 0 0 12px 0;
    color: #856404;
}

.choose {
    display: block;
    width: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.choose:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

/* Cart */
.cart-container {
    margin-bottom: 15px;
}

.empty-cart {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e1e5e9;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #666;
    font-size: 14px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #f5f5f5;
}

.cart-total {
    padding: 15px 0;
    border-top: 2px solid #e1e5e9;
    text-align: center;
    font-size: 18px;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.checkout-btn:hover {
    background: #45a049;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.modal-actions button[type="button"] {
    background: #f5f5f5;
    color: #666;
}

.modal-actions button[type="button"]:hover {
    background: #e0e0e0;
}

.modal-actions button[type="submit"] {
    background: #4caf50;
    color: white;
}

.modal-actions button[type="submit"]:hover {
    background: #45a049;
}

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

.payment-btn {
    display: inline-block;
    padding: 15px 30px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    margin: 20px 0;
    transition: background 0.3s ease;
}

.payment-btn:hover {
    background: #5a6fd8;
}

.payment-note {
    color: #666;
    font-size: 14px;
    margin-top: 15px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cart-section {
        grid-column: 1;
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-commands {
        justify-content: center;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}
