/* Version 1.0.0 - Initial release */
/* Main body styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #333;
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Main content wrapper */
.page-wrapper {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0 auto;
    overflow-x: hidden;
}
/* Top panel (white bar with Guided Discovery, Welcome, Logout) */
.nav-bar {
    display: flex;
    flex-direction: column;
    background-color: white;
    color: #333;
    flex-grow: 1;
    min-height: calc(100vh - 60px); /* Full height minus footer */
    width: 100%;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
}

/* Row styles for nav-bar */
.nav-row {
    width: 100%;
    box-sizing: border-box;
}

/* Top row with title, download link, and user info */
.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: relative; /* Add this line */
    /* border-bottom removed */
}

/* Top nav secondary - absolute position container for user controls that scrolls with the page */
.top-nav-secondary {
    position: absolute;
    top: -8px;
    right: 20px;
    height: 60px; /* Match the height of the top-row */
    z-index: 1002;
    display: flex;
    align-items: center;
}

/* Content row with discovery and summary panels */
.content-row {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Discovery panel */
.discovery-panel {
    width: 70%;
    flex-shrink: 1;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px;
    box-sizing: border-box;
    transition: width 0.1s ease;
}

/* Summary row */
.summary-row {
    padding: 0;
}

/* Container for both panels */
.panels-container {
    display: flex;
    width: 100%;
    gap: 20px; /* Increased gap between panels */
    margin-top: 20px;
    align-items: flex-start;
    max-width: 1400px; /* Added maximum width to prevent excessive stretching */
    margin-left: auto;
    margin-right: auto;
    /* Remove flex-grow as the nav-bar will handle the vertical expansion */
}

.nav-title {
    font-size: 20px;
    font-weight: bold;
    color: #008080;
    margin-left: 20px; /* Add space between sidebar and title */
}
.nav-user {
    display: flex;
    align-items: center;
    /* Remove absolute positioning since it's now in .top-nav-secondary */
    position: relative;
    /* Remove right and top positioning */
    /* Remove transform since vertical centering is handled by parent */
    z-index: 1002; /* Keep above other elements */
}
.nav-user-info {
    margin-right: 15px;
}
.nav-link {
    color: #008080;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(0, 128, 128, 0.1);
}
.nav-link:hover {
    background-color: rgba(0, 128, 128, 0.2);
}
/* Discovery panel */
.container {
    display: flex;
    flex: 1;
    width: 100%;
    background-color: #fff;
    padding: 30px 20px;
    border-radius: 0;
    /* box-shadow removed */
    box-sizing: border-box;
    overflow: hidden;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.summary-panel {
    width: 30%;
    background-color: #f9f9f9;
    border-radius: 0;
    border-left: none; /* Removed as we now have a divider */
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: none;
    flex-shrink: 0;
    flex-grow: 0;
    height: auto;
    max-height: none;
    box-sizing: border-box;
    transition: width 0.1s ease;
}

/* Panel divider styles */
.panel-divider {
    width: 3px;
    background-color: #ddd;
    cursor: col-resize;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    flex-grow: 0;
}

.panel-divider:hover, 
.panel-divider.dragging {
    background-color: #008080;
}

/* Mobile styles - hide summary panel and divider */
@media (max-width: 767px) {
    .summary-panel,
    .panel-divider {
        display: none;
    }
    
    .discovery-panel {
        width: 100% !important;
    }
    
    .content-row {
        flex-direction: column;
    }
}

/* Adjust main content area to make room for the panel */
@media (min-width: 768px) {
    body {
        padding-right: 0;
    }
    
    .container {
        max-width: 100%;
        margin-right: 0;
    }
}

.summary-panel.collapsed {
    width: 40px;
    overflow: hidden;
    transform-origin: center left;
    border-radius: 0;
}

.summary-panel.collapsed .summary-title,
.summary-panel.collapsed #summary-content {
    display: none;
}

/* When panel is collapsed, adjust the grid layout */
body:has(.summary-panel.collapsed) {
    grid-template-columns: 1fr 30px;
}

.summary-toggle {
    width: 18px;
    height: 30px;
    background-color: #006666;
    color: white;
    border: none;
    border-radius: 4px 0 0 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    position: absolute;
    left: 0;
    transform: translateX(-100%);
}

.summary-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    justify-content: flex-start;
}

.summary-title {
    font-weight: bold;
    color: #333;
    font-size: 16px;
    margin-left: 10px;
    flex-grow: 1;
}

.summary-item {
    margin-bottom: 15px;
}

.summary-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    display: block;
    font-size: 14px;
}

.summary-value {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
    word-break: break-word;
}

.summary-answer {
    color: #008080; /* Teal color */
    font-weight: normal;
}

/* Style for question text in summary panel */
.summary-question {
    font-weight: normal;
    color: #555;
}
h1 {
    color: #2196F3;
    margin-top: 0;
}
.input-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: row; /* Changed to row for horizontal layout */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 0; /* Remove gap between items */
}

.input-suggestions-wrapper {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 200px;
}

.suggestions-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: stretch;
}

.suggestions-toggle {
    height: 42px;
    width: 25px; /* Reduced to 3/5 of original 42px (rounded to nearest pixel) */
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    flex-shrink: 0;
    align-self: flex-start; /* Align to the top of the container */
    margin-top: 0; /* Align with the top of the textarea */
}

.suggestions-toggle:hover {
    color: white;
    background-color: #008080;
    border-radius: 10%;
}

#suggestions-dropdown-container {
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 1000;
    width: calc(100% - 20px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-top: 5px;
    max-height: none !important; /* Remove height restriction */
    overflow-y: visible !important; /* Show all content */
}

.suggestions-dropdown {
    background-color: white;
    max-height: none !important; /* Override any max-height settings */
    overflow-y: visible !important; /* Show all content without scrollbar */
    width: 100%;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

#inputText {
    flex-grow: 1;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 20px; /* Increased from 4px to 20px for more rounded corners */
    padding: 10px 15px; /* Slightly increased horizontal padding for better text alignment with rounded corners */
    box-sizing: border-box;
    height: 42px; /* Match button height */
    min-height: 42px; /* Set minimum height */
    max-height: 42px; /* Prevent expanding beyond button height */
    line-height: 1.5;
    resize: none; /* Disable resizing to maintain consistent height */
    font-family: inherit; /* Maintain consistent font */
    font-size: 16px; /* Explicit font size */
    overflow-y: auto; /* Add scrollbar when content exceeds height */
    max-width: 100%;
    transition: box-shadow 0.2s ease-in-out; /* Smooth transition for the shadow effect */
}

#inputText:hover {
    box-shadow: 0 0 4px rgba(0, 128, 128, 0.3); /* Teal-colored shadow to match the app's theme */
}

#inputText:focus {
    box-shadow: 0 0 4px rgba(0, 128, 128, 0.3);
    outline: none; /* Remove the default focus outline */
    border-color: #008080; /* Teal border to match the app's theme */
}

input[type="text"]:not(#inputText) {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.button-container {
    display: flex;
    gap: 10px;
    margin: 0 0 0 10px; /* Space between suggestions button and button container */
    justify-content: flex-end;
    box-sizing: border-box;
    flex-wrap: nowrap;
    align-self: flex-start; /* Align to the top of the container */
    margin-top: 0; /* Align with the top of the textarea */
}

@media (min-width: 768px) {
    .input-container {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .button-container {
        width: auto;
        margin-top: 0;
    }
}

/* Responsive adjustments for narrow screens */
@media (max-width: 767px) {
    .container {
        padding: 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .suggestions-container {
        margin-bottom: 10px;
    }
    
    .button-container {
        width: 100%;
        margin-top: 10px;
        justify-content: space-between;
    }
    
    .summary-panel {
        position: static;
        width: 100%;
        margin-top: 20px;
        max-height: none;
    }
    
    .panels-container {
        flex-direction: column-reverse;
    }
    
    .main-content {
        width: 100%;
    }
    
    /* Adjust layout for mobile */
    .nav-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .nav-user {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
    
    /* Make buttons more touch-friendly on mobile */
    button {
        padding: 12px 15px;
        min-width: 80px;
    }
    
    /* Make the input field and buttons stack better */
    .input-container {
        flex-direction: column;
    }
    
    /* Ensure buttons are properly sized on mobile */
    .button-container {
        display: flex;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .button-container button {
        flex: 1;
        margin-right: 5px;
        max-width: calc(50% - 5px);
    }
    
    .button-container button:last-child {
        margin-right: 0;
    }
}

button {
    padding: 10px 20px;
    background-color: #008080;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    height: 42px; /* Standard height */
    box-sizing: border-box;
}
button:hover {
    background-color: #006666;
}
button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}
#submitButton, .submit-button {
    background-color: #008080; /* Teal */
}
#submitButton:hover, .submit-button:hover {
    background-color: #006666; /* Darker teal for hover */
}
#finishButton, .finish-button {
    background-color: #008080; /* Teal */
    /* background-color: #0153a5; Dark teal */
    /* background-color: #fa4f00; Dark orange */
}
#finishButton:hover, .finish-button:hover {
    background-color: #006666; /* Darker teal for hover */
    /* background-color: #003367; Darker teal for hover */
    /* background-color: #bf3c00; Darker orange for hover */
}

/* Keep asking me button styling */
.next-button {
    background-color: #fa4f00; /* Orange */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    height: 42px; /* Standard height */
    box-sizing: border-box;
    font-weight: 500; /* Slightly bolder text */
}
.next-button:hover {
    background-color: #bf3c00; /* Darker orange for hover */
}

/* Start Over button styling */
#startOverButton {
    background-color: #e1e1e1; /* Gray background */
    padding: 7px; /* Adjusted padding to accommodate the image while maintaining height */
}
#startOverButton:hover {
    background-color: #c3c3c3; /* Darker gray for hover */
}
#startOverButton img {
    max-height: 28px;
    width: auto;
}
#result {
    margin-top: 20px;
    /* Removed container styling */
}
.step-container {
    margin-top: 20px;
}
.step {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.step-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
    color: #008080;
}
.step-content {
    line-height: 1.5;
}
.user-input {
    background-color: #e6f7ff;
    border-left: 3px solid #1890ff;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Code formatting */
pre {
    white-space: pre-wrap;
    overflow-x: auto;
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
}

/* Option buttons */
.option-button {
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 5px 10px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #000; /* Black text for unselected buttons */
    transition: background-color 0.2s;
}

.option-button:hover {
    background-color: #00808021; /* Lighter teal on hover */
    border-color: #008080;
}

.option-button.selected {
    background-color: #008080; /* Teal background for selected buttons */
    color: white; /* White text for selected buttons */
    border-color: #005f5f;
}

/* Shopping Carousel Styles */
.shopping-container {
    max-width: 100%;
    margin: 15px 0;
    padding: 0;
}

/* URL Carousel Styles */
.links-container .shopping-container {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

#photo-carousel.shopping-carousel {
    width: 100%;
    height: auto;
    position: relative;
    margin: 20px 0;
}

.carousel-container {
    width: 100%;
    overflow-x: hidden;
    position: relative;
    padding: 15px 0;
}

.carousel-slides {
    display: flex;
    transition: transform 0.3s ease;
    gap: 16px;
    padding: 5px 0;
    cursor: grab;
    user-select: none;
}

.carousel-slides.grabbing {
    cursor: grabbing;
    transition: none;
}

.carousel-slide {
    min-width: 200px;
    width: 200px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background-color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    height: 280px;
    display: flex;
    flex-direction: column;
}

.carousel-slide:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.carousel-slide img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background-color: #f8f8f8;
    padding: 10px;
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #202124;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.4;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: #202124;
    margin-bottom: 4px;
}

.product-merchant {
    font-size: 12px;
    color: #5f6368;
    margin-top: auto;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-top: 6px;
}

.rating-stars {
    color: #fbbc04;
    font-size: 12px;
    margin-right: 4px;
}

.rating-count {
    font-size: 12px;
    color: #5f6368;
}

/* Shadow indicators for scrolling */
.carousel-shadow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.carousel-shadow.left {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.carousel-shadow.right {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}

/* Navigation buttons */
.carousel-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 18px;
    color: #000; /* Black text color for the < and > symbols */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: opacity 0.3s, transform 0.2s;
    opacity: 0;
    pointer-events: none;
}

.carousel-nav-button:hover {
    background-color: #f8f8f8;
    transform: translateY(-50%) scale(1.05);
}

.carousel-nav-button:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav-button.prev {
    left: 10px;
}

.carousel-nav-button.next {
    right: 10px;
}

.carousel-nav-button.visible {
    opacity: 1;
    pointer-events: auto;
}

.carousel-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.carousel-indicator.active {
    background-color: white;
}

/* Debug info section */
.debug-info {
    margin-top: 20px;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
}

/* Table Styles */
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px; /* Add some space above the table */
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* Optional: Hover effect for rows */
tr:hover {
    background-color: #f5f5f5;
}

/* Hide the suggestions button (chevron) while maintaining its functionality */
.suggestions-toggle {
    display: none !important; /* Use !important to ensure it's hidden */
    visibility: hidden;       /* Double protection to ensure it's not visible */
}

/* User Profile Button and Dropdown Styles */
.user-profile-container {
    position: relative;
    margin-left: 10px;
}

.user-profile-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #008080; /* Teal color */
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s;
}

.user-profile-button:hover {
    background-color: #006666; /* Darker teal on hover */
}

.user-profile-dropdown {
    position: absolute;
    right: 0;
    top: 45px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 200px;
    display: none;
    z-index: 1000;
}

.user-profile-dropdown.active {
    display: block;
}

.dropdown-email-container {
    padding: 12px 15px;
    color: #333;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background-color: #eee;
    margin: 0;
}

.dropdown-logout {
    display: block;
    padding: 12px 15px;
    color: #d9534f; /* Red color for logout */
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.dropdown-logout:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

/* Share button */
.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 128, 128, 0.1);
    color: #008080;
    text-decoration: none;
    transition: background-color 0.2s;
}

.share-button:hover {
    background-color: rgba(0, 128, 128, 0.2);
}

/* Tooltip styling */
.share-button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}