/* CSS переменные для цветовой схемы */
:root {
    --primary-color: #0c4da2; /* Основной синий цвет */
    --primary-color-rgb: 12, 77, 162; /* RGB значения для основного цвета */
    --accent-color: #ffd700; /* Акцентный золотой цвет */
    --accent-color-rgb: 255, 215, 0; /* RGB значения для акцентного цвета */
}

/* Additional SEO improvements */
.contact-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}

/* Кнопка наверх (скрыта) */
.back-to-top {
    display: none;
}

/* Анимации при прокрутке */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Плавная прокрутка для всей страницы */
html {
    scroll-behavior: smooth;
}

/* Стили для калькулятора стоимости */
.calculator {
    background-color: var(--light-color);
    padding: 80px 0;
}

.calculator-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}

.calculator-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculator-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.calculator-group {
    flex: 1;
    min-width: 250px;
}

.calculator-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.calculator-group select,
.calculator-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.calculator-group select:focus,
.calculator-group input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.calculator-result {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.price-display span {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 5px;
}

#calculated-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.calculator-note {
    text-align: center;
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.calculate-btn,
.request-btn {
    min-width: 200px;
    margin: 5px;
}

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

.request-btn {
    background-color: var(--secondary-color);
}

/* Адаптивность для калькулятора */
@media (max-width: 768px) {
    .calculator-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .calculator-group {
        width: 100%;
    }
    
    .calculator-wrapper {
        padding: 20px;
    }
    
    #calculated-price {
        font-size: 1.8rem;
    }
    
    .calculate-btn,
    .request-btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Стили для чат-бота */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999; /* Увеличиваем z-index, чтобы чат был над всеми элементами */
}

/* Стили для формы подписки */
.subscribe-section {
    background-color: rgba(51, 51, 51, 0.9); /* Цвет как в контактной форме, но с прозрачностью */
    padding: 60px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.subscribe-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.subscribe-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: rgba(51, 51, 51, 0.7); /* Добавляем полупрозрачный фон для внутреннего блока */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.subscribe-content {
    max-width: 600px;
    margin-bottom: 30px;
}

.subscribe-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subscribe-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 0;
}

.subscribe-form {
    width: 100%;
    max-width: 550px;
}

.subscribe-form .form-group {
    display: flex;
    margin-bottom: 15px;
    width: 100%;
}

.subscribe-form input[type="email"] {
    flex: 1;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
    min-width: 0; /* Предотвращает переполнение на мобильных устройствах */
}

.subscribe-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.subscribe-form input[type="email"]:focus {
    background-color: rgba(255, 255, 255, 0.2);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

.subscribe-form button {
    padding: 15px 25px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap; /* Предотвращает перенос текста кнопки */
}

.subscribe-form button:hover {
    background-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form-privacy {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    text-align: left;
    line-height: 1.4;
}

.form-privacy input[type="checkbox"] {
    margin-right: 8px;
    min-width: 18px;
    min-height: 18px;
    margin-top: 2px;
    position: relative;
    width: 16px;
    height: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    vertical-align: middle;
}

.form-privacy input[type="checkbox"]:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-privacy input[type="checkbox"]:checked::after {
    content: '\2714';
    position: absolute;
    top: -1px;
    left: 3px;
    color: white;
    font-size: 12px;
}

.form-privacy a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
    transition: all 0.3s ease;
}

.form-privacy a:hover {
    color: #d4af37;
    border-bottom-color: #d4af37;
}

@media (min-width: 768px) {
    .subscribe-wrapper {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
        align-items: center;
    }
    
    .subscribe-content {
        margin-bottom: 0;
        margin-right: 30px;
    }
}

@media (max-width: 767px) {
    .subscribe-form .form-group {
        flex-direction: column;
    }
    
    .subscribe-form input[type="email"] {
        border-radius: 5px;
        margin-bottom: 10px;
    }
    
    .subscribe-form button {
        border-radius: 5px;
        width: 100%;
    }
}

/* Стили для обертки основного контента */
.main-content-wrapper {
    position: relative;
    background-color: #f8f9fa;
    background-image: 
        radial-gradient(rgba(var(--primary-color-rgb), 0.03) 1px, transparent 1px),
        radial-gradient(rgba(var(--accent-color-rgb), 0.03) 1px, transparent 1px);
    background-size: 20px 20px, 30px 30px;
    background-position: 0 0, 15px 15px;
    box-shadow: 
        inset 0 5px 15px rgba(0, 0, 0, 0.03),
        inset 0 -5px 15px rgba(0, 0, 0, 0.03);
    padding-bottom: 30px;
    overflow: hidden;
}

.main-content-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.03) 0%, rgba(var(--accent-color-rgb), 0.03) 100%),
        url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 0 L50 50 L100 0 L50 -50" fill="none" stroke="rgba(12, 77, 162, 0.02)" stroke-width="1"/></svg>');
    background-size: cover, 100px 100px;
    z-index: 0;
    pointer-events: none;
}

.main-content-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, rgba(var(--primary-color-rgb), 0.2), rgba(var(--accent-color-rgb), 0.2));
    z-index: 2;
}

.main-content-wrapper > section {
    position: relative;
    z-index: 1;
    background-color: transparent;
}

/* Добавляем тени для секций внутри обертки */
.main-content-wrapper > section {
    margin-bottom: 30px;
}

.main-content-wrapper > section:not(.subscribe-section) {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding-top: 40px;
    padding-bottom: 40px;
    margin-top: 30px;
    overflow: hidden;
}

/* Стили для анимированных иконок услуг */
.service-icon {
    position: relative;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1) 0%, rgba(var(--accent-color-rgb), 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: all 0.5s ease;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.2) 0%, rgba(var(--accent-color-rgb), 0.2) 100%);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
    z-index: 1;
}

.service-icon i {
    font-size: 32px;
    color: var(--primary-color);
    position: relative;
    z-index: 2;
    transition: all 0.5s ease;
}

.service-card:hover .service-icon {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.service-card:hover .service-icon::before {
    opacity: 1;
    transform: scale(1);
}

.service-card:hover .service-icon i {
    color: var(--accent-color);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

/* Специальные анимации для каждой иконки */
.service-icon.web-icon:hover i {
    animation: spin-bounce 1.5s infinite alternate;
}

.service-icon.ads-icon:hover i {
    animation: pop-fade 1.5s infinite alternate;
}

.service-icon.automation-icon:hover i {
    animation: gear-rotate 3s linear infinite;
}

@keyframes spin-bounce {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pop-fade {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Стили для уведомлений */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.notification {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out forwards;
    max-width: 350px;
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #F44336;
}

.notification.hide {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent; /* Убираем подсветку на мобильных */
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    background-color: var(--secondary-color);
}

.chatbot-toggle:active {
    transform: scale(0.95); /* Эффект нажатия на мобильных */
}

.chatbot-toggle i {
    font-size: 24px;
}

.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: red;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    display: none;
}

.chatbot-box {
    position: fixed; /* Меняем на fixed вместо absolute */
    bottom: 100px; /* Увеличиваем отступ снизу */
    left: 30px; /* Фиксируем позицию слева */
    width: 350px;
    max-width: calc(100vw - 60px); /* Ограничиваем ширину на маленьких экранах */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    flex-direction: column;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    z-index: 9999; /* Добавляем z-index и для самого окна чата */
}

.chatbot-box.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.chatbot-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px; /* Увеличиваем область нажатия для мобильных */
    margin: -5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.message {
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4; /* Улучшаем читаемость */
    font-size: 0.95rem; /* Оптимальный размер для мобильных */
}

.bot-message {
    background-color: #f1f1f1;
    align-self: flex-start;
    border-bottom-left-radius: 2px; /* Стилизация как в популярных мессенджерах */
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px; /* Стилизация как в популярных мессенджерах */
}

.chatbot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

.chatbot-input input {
    flex: 1;
    padding: 12px; /* Увеличиваем поле ввода для мобильных */
    border: 1px solid #ddd;
    border-radius: 20px; /* Более современный вид */
    font-size: 0.95rem;
    -webkit-appearance: none; /* Убираем стандартные стили на iOS */
    -moz-appearance: none;
    appearance: none;
}

.chatbot-input button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%; /* Круглая кнопка как в мессенджерах */
    width: 40px;
    height: 40px;
    padding: 0;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input button:hover {
    background-color: var(--secondary-color);
}

.chatbot-input button:active {
    transform: scale(0.95); /* Эффект нажатия на мобильных */
}

.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    border-top: 1px solid #eee;
    justify-content: center; /* Центрируем на маленьких экранах */
}

.suggestion-btn {
    background-color: #f1f1f1;
    border: none;
    border-radius: 15px;
    padding: 8px 12px; /* Увеличиваем для мобильных */
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap; /* Предотвращаем перенос текста */
    margin-bottom: 5px; /* Добавляем отступ снизу */
}

.suggestion-btn:hover {
    background-color: #e0e0e0;
}

.suggestion-btn:active {
    transform: scale(0.95); /* Эффект нажатия на мобильных */
}

/* Индикатор набора текста */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-width: 50px;
    max-width: 50px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* Адаптивность для чат-бота */
@media (max-width: 480px) {
    .chatbot-container {
        bottom: 20px;
        left: 20px;
    }
    
    .chatbot-box {
        width: 300px;
    }
    
    .chatbot-messages {
        height: 250px;
    }
}
