/* Modern redesigned styles for Bridge of Sales */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4361ee;
    --primary-light: #ebf0ff;
    --primary-dark: #3a56d4;
    --secondary-color: #48cae4;
    --accent-color: #ff9e00;
    --text-dark: #1e293b;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --border-light: #e5e7eb;
    --transition-speed: 0.3s;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --card-radius: 16px;
    --button-radius: 10px;
    --input-radius: 10px;
}

/* Dark Mode Variables */
.dark-mode {
    --primary-color: #5d7bff;
    --primary-light: rgba(93, 123, 255, 0.15);
    --primary-dark: #4361ee;
    --text-dark: #f8fafc;
    --text-medium: #cbd5e1;
    --text-light: #94a3b8;
    --bg-white: #1e293b;
    --bg-light: #0f172a;
    --border-light: #334155;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --box-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-container {
    display: flex;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    background-color: var(--bg-white);
    box-shadow: var(--box-shadow);
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

/* Panel styles */
.filter-panel, .assistant-panel {
    background-color: var(--bg-white);
    width: 320px;
    overflow-y: auto;
    transition: all var(--transition-speed) ease;
    z-index: 10;
}

.filter-panel {
    border-right: 1px solid var(--border-light);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.03);
}

.assistant-panel {
    display: flex;
    flex-direction: column;
    width: 420px;
    border-left: 1px solid var(--border-light);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.03);
}

.product-panel {
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--bg-light);
    transition: all var(--transition-speed) ease;
}

.panel-content {
    padding: 30px;
}

/* Filter panel styles */
.filter-panel h2 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text-dark);
    position: relative;
}

.filter-panel h2:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    height: 3px;
    width: 40px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.filter-panel h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 28px 0 16px 0;
    color: var(--text-medium);
    transition: color var(--transition-speed) ease;
}

.search-box {
    position: relative;
    margin-bottom: 30px;
}

.search-box input {
    width: 100%;
    padding: 15px 45px 15px 18px;
    border: 1px solid var(--border-light);
    border-radius: var(--input-radius);
    font-size: 15px;
    background-color: var(--bg-light);
    transition: all var(--transition-speed) ease;
    color: var(--text-dark);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
    background-color: var(--bg-white);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 16px;
    pointer-events: none;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-checkbox {
    margin: 10px 0;
    color: var(--text-medium);
    font-size: 15px;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    transition: color var(--transition-speed) ease;
}

.filter-checkbox:hover {
    color: var(--primary-color);
}

.filter-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.filter-checkbox input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
}

.filter-checkbox:hover .checkmark {
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Button styles */
.primary-button, .secondary-button {
    padding: 13px 22px;
    border-radius: var(--button-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25);
}

.primary-button:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.35);
    transform: translateY(-1px);
}

.secondary-button {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid transparent;
}

.secondary-button:hover {
    background-color: var(--bg-white);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Reset button style */
#resetFilters {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-size: 14px;
}

/* Product panel styles */
.product-panel h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Search results row with language selector */
.search-results-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.language-selector {
    display: flex;
    align-items: center;
    background-color: var(--bg-white);
    padding: 8px 15px;
    border-radius: var(--button-radius);
    box-shadow: var(--box-shadow);
    z-index: 20;
}

.language-selector span {
    margin-right: 12px;
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

.language-selector select {
    padding: 8px 28px 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--input-radius);
    background-color: var(--bg-white);
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all var(--transition-speed) ease;
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Dark Mode Toggle */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: var(--primary-color);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-light);
}

input:checked + .slider:before {
    transform: translateX(25px);
}

.theme-icon {
    margin-right: 8px;
    color: var(--text-medium);
    font-size: 14px;
}

/* Product list styles */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.product-item {
    background-color: var(--bg-white);
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.product-item:hover {
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-3px);
}

.product-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform var(--transition-speed) ease;
}

.product-item:hover:before {
    transform: scaleY(1);
}

.product-item h4 {
    min-height: 3em;
    display: flex;
    align-items: flex-start;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 18px;
}

.product-meta span {
    margin-right: 10px;
    margin-bottom: 5px;
}

.product-description {
    min-height: 4.5em;
    line-height: 1.6;
    margin-bottom: 18px;
    color: var(--text-medium);
    font-size: 15px;
    flex-grow: 1;
}

.certificate-tags {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.certificate-tag {
    background-color: var(--primary-light);
    border-radius: 6px;
    padding: 6px 10px;
    margin: 0 8px 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
    transition: all var(--transition-speed) ease;
}

.certificate-tag:hover {
    background-color: var(--primary-color);
    color: white;
}

.product-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: auto;
}

.product-actions button {
    padding: 10px 16px;
    font-size: 14px;
}

.export-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

/* Assistant panel styles */
.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 25px;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-white);
}

.assistant-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    position: relative;
    display: flex;
    align-items: center;
}

.assistant-header h2:before {
    content: '🤖';
    margin-right: 8px;
    font-size: 20px;
}

.assistant-header p {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

/* Assistant name display */
.assistant-name-display {
    padding: 12px 18px;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
    color: var(--primary-color);
    text-align: center;
    font-size: 15px;
}

.chat-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(var(--primary-light) 1px, transparent 1px),
        radial-gradient(var(--primary-light) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    background-attachment: fixed;
}

.chat-message {
    margin-bottom: 20px;
}

.message-author {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 5px;
}

.user-author {
    text-align: right;
    margin-right: 12px;
    margin-left: 60px;
    color: var(--primary-color);
}

.assistant-author {
    text-align: left;
    margin-left: 12px;
    margin-right: 60px;
    color: var(--text-dark);
}

.message-bubble {
    padding: 18px;
    border-radius: 16px;
    line-height: 1.5;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    max-width: 85%;
}

.user-message {
    background-color: var(--primary-light);
    border: 1px solid rgba(67, 97, 238, 0.1);
    border-radius: 16px 16px 0 16px;
    float: right;
    clear: both;
    margin-right: 10px;
    color: var(--text-dark);
}

.assistant-message {
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 16px 16px 16px 0;
    float: left;
    clear: both;
    margin-left: 10px;
    color: var(--text-dark);
}

.input-container {
    display: flex;
    padding: 18px 25px;
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-light);
    gap: 15px;
}

.input-box {
    flex-grow: 1;
    position: relative;
}

.input-box input {
    width: 100%;
    padding: 15px 18px;
    border: 1px solid var(--border-light);
    border-radius: var(--input-radius);
    font-size: 15px;
    background-color: var(--bg-light);
    transition: all var(--transition-speed) ease;
    color: var(--text-dark);
}

.input-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
    background-color: var(--bg-white);
}

/* Clear button */
#clearHistory {
    font-size: 14px;
    padding: 8px 14px;
}

/* Clearfix */
.chat-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-item {
    animation: fadeIn 0.3s ease forwards;
}

/* Dark Mode Specific Styling */
.dark-mode .product-item {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #334155;
}

.dark-mode .product-item:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #4b5563;
}

.dark-mode .certificate-tag {
    background-color: rgba(93, 123, 255, 0.15);
    color: #5d7bff;
}

.dark-mode .chat-container {
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(rgba(93, 123, 255, 0.1) 1px, transparent 1px),
        radial-gradient(rgba(93, 123, 255, 0.1) 1px, transparent 1px);
}

.dark-mode .primary-button {
    box-shadow: 0 4px 12px rgba(93, 123, 255, 0.25);
}

.dark-mode .user-message {
    background-color: rgba(93, 123, 255, 0.15);
    border: 1px solid rgba(93, 123, 255, 0.2);
}

.dark-mode .assistant-message {
    background-color: #1e293b;
    border: 1px solid #334155;
}

/* Responsive design */
@media (max-width: 1400px) {
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }
    
    .filter-panel, .assistant-panel {
        width: 100%;
        max-height: 500px;
    }
    
    .filter-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    
    .assistant-panel {
        border-left: none;
        border-top: 1px solid var(--border-light);
    }
    
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0;
    }
    
    .panel-content {
        padding: 20px;
    }
    
    .product-list {
        grid-template-columns: 1fr;
    }
    
    .search-results-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .language-selector {
        align-self: flex-end;
    }
}


/* Дополнительные стили для улучшения мобильной версии */

/* Улучшенная поддержка мобильных устройств */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
    }
    
    .main-container {
        flex-direction: column;
        height: auto;
        max-height: none;
        overflow: visible;
    }
    
    .filter-panel, .product-panel, .assistant-panel {
        width: 100%;
        max-height: none;
        overflow-y: visible;
    }
    
    .filter-panel, .product-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    
    .assistant-panel {
        border-left: none;
        border-top: 1px solid var(--border-light);
        height: auto;
        min-height: 400px;
        position: relative;
    }
    
    .chat-container {
        max-height: 300px;
        overflow-y: auto;
    }
    
    /* Улучшение отображения карточек продуктов */
    .product-list {
        grid-template-columns: 1fr;
    }
    
    /* Улучшение отображения кнопок экспорта */
    .export-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        margin: 20px 0;
    }
    
    /* Добавляем индикатор прокрутки к панели ассистента */
    .assistant-panel::after {
        content: "";
        display: block;
        height: 5px;
        background: linear-gradient(90deg, var(--primary-light), var(--primary-color), var(--primary-light));
        position: absolute;
        top: -5px;
        left: 0;
        right: 0;
        border-radius: 5px;
    }
    
    /* Улучшенное отображение панели фильтров на мобильных устройствах */
    .filter-panel {
        position: relative;
        padding-bottom: 20px;
    }
    
    /* Создаем закрепленную кнопку для быстрого доступа к ассистенту */
    .scroll-to-assistant {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: var(--primary-color);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .scroll-to-assistant:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    }
    
    /* В мобильной версии скрываем подзаголовки панелей для экономии места */
    @media (max-width: 480px) {
        .assistant-header p,
        .filter-panel h2 {
            font-size: 18px;
        }
        
        .panel-content {
            padding: 15px;
        }
        
        .search-box input,
        .input-box input {
            padding: 12px 15px;
        }
        
        .primary-button, .secondary-button {
            padding: 10px 15px;
            font-size: 14px;
        }
    }
}

/* Добавляем плавный скролл для всей страницы */
html {
    scroll-behavior: smooth;
}

/* Запрещаем горизонтальный скролл на мобильных устройствах */
body {
    overflow-x: hidden;
}


/* Эти стили можно добавить в основной файл стилей (styles.css или main.css) */

/* Исправление для основной компоновки страницы */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    flex-shrink: 0;
}

.page-banner {
    flex-shrink: 0;
}

.main-container {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
}

/* Дополнительные специфичные стили для страницы продуктов */
body .products-page {
    flex: 1 0 auto;
    display: flex;
    flex-direction: row;
}

@media (max-width: 992px) {
    body .products-page {
        flex-direction: column;
    }
}

/* Исправление проблемы с прокруткой */
.products-page .product-panel {
    overflow-y: auto;
}

/* Убедимся, что контент не выходит за пределы панелей */
.products-page .panel-content {
    height: 100%;
    overflow-y: auto;
}


/* Styles for Bridging the Gap and Your Benefits sections */

/* Common styles */
.section-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 10px;
}

.section-divider {
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 0 auto 30px;
    border-radius: 2px;
}

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-medium);
}

/* Bridging the Gap Section */
.bridging-section {
    padding: 70px 0;
    background-color: var(--bg-white);
}

.challenges-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 30px;
}

.challenge-block {
    flex: 1;
    min-width: 300px;
}

.challenge-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.challenge-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.challenge-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 15px;
    line-height: 1.5;
    color: var(--text-medium);
}

.challenge-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 20px;
    line-height: 1;
}

.challenge-list li strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Your Benefits Section */
.benefits-section.clean {
    padding: 70px 0;
    background-color: var(--bg-light);
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 50px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.benefit-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.benefit-content {
    flex: 1;
}

.benefit-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.benefit-text {
    color: var(--text-medium);
    margin: 0;
    line-height: 1.5;
}

/* Distribution Model */
.model-section {
    margin-top: 50px;
}

.model-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.model-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.model-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.model-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.model-text {
    flex: 1;
    margin: 0;
    color: var(--text-medium);
    line-height: 1.5;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .challenges-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .challenge-block {
        width: 100%;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .challenge-title,
    .model-title {
        font-size: 22px;
    }
    
    .benefit-title {
        font-size: 20px;
    }
}


