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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header Top Bar with Explain Button */
.header-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.header-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    cursor: pointer;
}

.header-title:hover {
    color: #4285f4;
}

.explain-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(26, 26, 46, 0.2);
}

.explain-button:hover {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    box-shadow: 0 4px 8px rgba(26, 26, 46, 0.3);
}

.explain-button:active {
    transform: scale(0.98);
}

.explain-button i {
    font-size: 14px;
    color: #ffc107;
}

.search-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.search-input-container {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4285f4;
}

.search-button {
    padding: 12px 24px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background: #3367d6;
}

/* Customer Input Styles */
.customer-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.customer-label {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    white-space: nowrap;
}

.customer-input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.customer-input:focus {
    outline: none;
    border-color: #4285f4;
}

.customer-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #34a853;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.customer-button:hover {
    background: #2d8f47;
}

.customer-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.campaign-label {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* Custom dropdown */
.campaign-dropdown {
    position: relative;
    flex: 0 0 280px;
    width: 280px;
}

.campaign-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    width: 100%;
    height: 38px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    text-align: left;
    box-sizing: border-box;
}

.campaign-dropdown-btn:hover {
    border-color: #bcc0c5;
}

.campaign-dropdown-btn.open {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

.campaign-dropdown-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.campaign-dropdown-btn i {
    font-size: 11px;
    color: #9aa0a6;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.campaign-dropdown-btn.open i {
    transform: rotate(180deg);
    color: #4285f4;
}

.campaign-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.campaign-dropdown-menu.open {
    display: block;
}

.campaign-dropdown-option {
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.12s ease;
    white-space: nowrap;
    user-select: none;
}

.campaign-dropdown-option:hover {
    background: #f1f3f4;
}

.campaign-dropdown-option.selected {
    background: #e8f0fe;
    color: #4285f4;
    font-weight: 500;
}

/* Refresh campaigns button */
.refresh-campaigns-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: white;
    color: #5f6368;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.refresh-campaigns-btn:hover {
    border-color: #4285f4;
    color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.refresh-campaigns-btn:active {
    background: #f1f3f4;
}

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

.spinning {
    animation: spin 0.7s linear infinite;
}

.json-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.3);
}

.json-button:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.4);
}

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

.json-button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-success {
    border-left: 4px solid #34a853;
}

.notification-error {
    border-left: 4px solid #ea4335;
}

.notification-info {
    border-left: 4px solid #4285f4;
}

.notification-content i {
    font-size: 18px;
}

.notification-success .notification-content i {
    color: #34a853;
}

.notification-error .notification-content i {
    color: #ea4335;
}

.notification-info .notification-content i {
    color: #4285f4;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f1f3f4;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #5f6368;
}

.filter-pill:hover {
    background: #e8eaed;
}

.filter-pill.active {
    background: #4285f4;
    color: white;
}

.color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.color-indicator.black {
    background: #000;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

/* Sidebar Styles */
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 24px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.filter-section {
    margin-bottom: 24px;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 20px;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: #5f6368;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-item:hover {
    color: #4285f4;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.filter-header h4 {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
}

.filter-header i {
    color: #5f6368;
    font-size: 12px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
    font-size: 14px;
    color: #5f6368;
}

.radio-option input,
.checkbox-option input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #dadce0;
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
}

.radio-option .checkmark {
    border-radius: 50%;
}

.radio-option input:checked + .checkmark,
.checkbox-option input:checked + .checkmark {
    background: #4285f4;
    border-color: #4285f4;
}

.radio-option input:checked + .checkmark::after,
.checkbox-option input:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.checkbox-option input:checked + .checkmark::after {
    border-radius: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.price-inputs {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 12px;
    color: #5f6368;
    font-weight: 500;
}

.input-group input {
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
}

.go-button {
    padding: 8px 16px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    align-self: flex-start;
}

.go-button:hover {
    background: #3367d6;
}

/* Results Area */
.results-area {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.more-options {
    background: none;
    border: none;
    color: #5f6368;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.more-options:hover {
    background: #f1f3f4;
}

/* Products Container */
.products-container {
    position: relative;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 8px 0;
    width: 100%;
    min-height: 200px;
}

@media (max-width: 1600px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Product Card */
.product-card {
    width: 100%;
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #4285f4;
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9aa0a6;
    font-size: 14px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-image i {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ea4335;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.product-id {
    font-size: 10px;
    color: #9aa0a6;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
    text-align: center;
}

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

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.product-seller {
    font-size: 12px;
    color: #5f6368;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.stars {
    color: #fbbc04;
    font-size: 12px;
}

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

.product-details {
    font-size: 12px;
    color: #5f6368;
    line-height: 1.3;
}

/* View Product Button */
.view-product-btn {
    width: 100%;
    padding: 8px 12px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.view-product-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

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

.view-product-btn i {
    font-size: 10px;
}

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

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #5f6368;
    cursor: pointer;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f1f3f4;
}

.modal-body {
    padding: 24px;
}

.modal-product-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #f8f9fa;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.no-image-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #9aa0a6;
    font-size: 16px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.no-image-modal i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.modal-product-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.3;
}

.modal-product-price {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.modal-product-seller {
    font-size: 16px;
    color: #5f6368;
    margin-bottom: 16px;
}

.modal-product-description {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-product-url {
    display: inline-block;
    padding: 12px 24px;
    background: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.modal-product-url:hover {
    background: #3367d6;
}

/* Full JSON Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 20px;
    color: #5f6368;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #e8eaed;
    color: #1a1a1a;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #5f6368;
    font-size: 16px;
}

.loading-indicator i {
    font-size: 20px;
}

.json-display {
    background: #1e1e1e;
    color: #f8f8f2;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: none;
    margin: 0;
    height: 100%;
    max-height: 70vh;
}

/* Activity Log */
.activity-log {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
}

.activity-log h4 {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.log-entries {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
}

.log-entry {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
    color: #5f6368;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    font-size: 12px;
    color: #9aa0a6;
    margin-top: 4px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .results-area {
        order: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .filter-pills {
        gap: 6px;
    }
    
    .filter-pill {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .product-card {
        width: 100%;
    }
    
    .activity-log {
        width: 250px;
        right: 10px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .search-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-input-container {
        width: 100%;
    }
    
    .filter-pills {
        justify-content: center;
    }
    
    .product-card {
        width: 100%;
    }
    
    .activity-log {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
    }
}

/* Product Detail View Styles */
.product-detail-view {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.detail-header {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.detail-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.detail-content {
    padding: 30px;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.product-detail-image-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.product-detail-image {
    width: 100%;
    max-width: 500px;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.product-detail-info-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e1e5e9;
}

.product-detail-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.3;
}

.product-detail-price {
    font-size: 32px;
    font-weight: 700;
    color: #4285f4;
    margin-bottom: 20px;
}

.product-detail-seller {
    font-size: 16px;
    color: #5f6368;
    margin-bottom: 20px;
}

.product-detail-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.product-detail-stars {
    color: #ffc107;
    font-size: 18px;
}

.product-detail-rating-count {
    color: #5f6368;
    font-size: 14px;
}

.product-detail-description {
    margin-bottom: 30px;
}

.product-detail-description-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.product-detail-description-text {
    color: #5f6368;
    line-height: 1.6;
}

.product-detail-specs {
    margin-bottom: 30px;
}

.product-detail-specs-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.product-detail-specs-list {
    list-style: none;
}

.product-detail-specs-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
}

.product-detail-specs-list li:last-child {
    border-bottom: none;
}

.product-detail-spec-label {
    font-weight: 500;
    color: #5f6368;
}

.product-detail-spec-value {
    color: #1a1a1a;
}

.product-detail-score-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.product-detail-score-button {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.product-detail-score-button:hover {
    background: linear-gradient(135deg, #3367d6, #2d8f47);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.product-detail-score-button:active {
    transform: translateY(0);
}

.product-detail-score-data {
    margin-top: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    animation: slideDown 0.3s ease;
}

.product-detail-score-data h4 {
    margin: 0 0 15px 0;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #4285f4;
    padding-bottom: 8px;
}

.product-detail-json-display {
    background: #1e1e1e;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #333;
    margin: 0;
}

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

/* Responsive Design for Product Detail View */
@media (max-width: 768px) {
    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detail-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .detail-content {
        padding: 20px;
    }
    
    .product-detail-image {
        height: 300px;
    }
}

/* Explain Modal Styles */
.explain-modal-content {
    max-width: 720px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.explain-modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 16px 24px;
    border-radius: 8px 8px 0 0;
}

.explain-modal-header h2 {
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.explain-modal-header h2 i {
    font-size: 18px;
    color: #ffc107;
}

.explain-modal-header .close-button {
    color: rgba(255, 255, 255, 0.7);
}

.explain-modal-header .close-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.explain-modal-body {
    padding: 20px 24px;
    max-height: 65vh;
    overflow-y: auto;
    background: #fafbfc;
}

.explain-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.explain-text {
    font-size: 13.5px;
    line-height: 1.65;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Markdown Headers */
.explain-text h1 {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 20px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #1a1a2e;
}

.explain-text h2 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 18px 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #e1e5e9;
}

.explain-text h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 16px 0 6px 0;
}

.explain-text h1:first-child,
.explain-text h2:first-child,
.explain-text h3:first-child {
    margin-top: 0;
}

.explain-text h4 {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin: 14px 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.explain-text h5,
.explain-text h6 {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    margin: 12px 0 4px 0;
}

/* Markdown Lists */
.explain-text ul,
.explain-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.explain-text li {
    margin: 4px 0;
    line-height: 1.55;
}

.explain-text li > ul,
.explain-text li > ol {
    margin: 2px 0;
}

/* Markdown Paragraphs */
.explain-text p {
    margin: 8px 0;
    line-height: 1.6;
}

.explain-text p:first-child {
    margin-top: 0;
}

.explain-text p:last-child {
    margin-bottom: 0;
}

/* Markdown Bold/Italic */
.explain-text strong {
    color: #1a1a2e;
    font-weight: 600;
}

.explain-text em {
    font-style: italic;
    color: #4a5568;
}

/* Markdown Inline Code */
.explain-text code {
    background: #e8eef3;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    color: #c7254e;
}

/* Markdown Code Blocks */
.explain-text pre {
    background: #1e1e2e;
    border-radius: 6px;
    padding: 12px 14px;
    margin: 10px 0;
    overflow-x: auto;
    border: 1px solid #2d3748;
}

.explain-text pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
    font-size: 11.5px;
    line-height: 1.45;
}

/* Markdown Blockquotes */
.explain-text blockquote {
    border-left: 3px solid #1a1a2e;
    margin: 12px 0;
    padding: 8px 14px;
    background: #f0f4f8;
    color: #4a5568;
    font-style: normal;
    border-radius: 0 4px 4px 0;
}

.explain-text blockquote p {
    margin: 0;
}

/* Markdown Horizontal Rules */
.explain-text hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 16px 0;
}

/* Markdown Links */
.explain-text a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
}

.explain-text a:hover {
    text-decoration: underline;
}

/* Markdown Tables */
.explain-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 12.5px;
}

.explain-text th,
.explain-text td {
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    text-align: left;
}

.explain-text th {
    background: #edf2f7;
    font-weight: 600;
    color: #2d3748;
}

.explain-text tr:nth-child(even) {
    background: #f7fafc;
}

/* Markdown Task Lists */
.explain-text input[type="checkbox"] {
    margin-right: 6px;
}

/* Insight callouts */
.explain-text strong:first-child {
    color: #2b6cb0;
}

/* Convergence Chart Styles */
.explain-chart-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title i {
    color: #3182ce;
    font-size: 16px;
}

.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
    min-height: 220px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 10px;
}

.chart-container canvas {
    max-width: 100%;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4a5568;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.chart-legend-item.selected {
    font-weight: 600;
    color: #1a1a2e;
}

/* Chart tooltip customization */
.chart-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.chart-stat {
    text-align: center;
    padding: 8px;
    background: #f7fafc;
    border-radius: 6px;
}

.chart-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.chart-stat-label {
    font-size: 10px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Chart placeholder when not enough data */
.chart-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: #f8fafc;
    border-radius: 6px;
    color: #718096;
    text-align: center;
    padding: 20px;
    margin-top: 10px;
}

.chart-placeholder i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #a0aec0;
}

.chart-placeholder p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.explain-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 13px;
}

.explain-error i {
    font-size: 16px;
    color: #dc2626;
}

/* Professional loading state */
.explain-modal-body .loading-indicator {
    padding: 40px 20px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.explain-modal-body .loading-indicator i {
    color: #1a1a2e;
    font-size: 18px;
}

/* Responsive styles for explain modal */
@media (max-width: 768px) {
    .explain-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .explain-modal-body {
        padding: 16px;
    }
    
    .header-top-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .explain-button {
        width: 100%;
        justify-content: center;
    }
}
