/* ============================================
   style.css - Основные стили для markup.by
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== ЛОГОТИП И ШАПКА ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.logo-icon svg {
    width: 40px;
    height: 40px;
}

.logo-text {
    text-align: left;
}

.logo-text h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.8;
}

/* ========== КНОПКА ИНСТРУКЦИИ ========== */
.btn-help {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-help:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-body h5 {
    color: #667eea;
    margin-top: 15px;
    margin-bottom: 10px;
}

.modal-body h5:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.step-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

.instruction-list {
    list-style: none;
    padding-left: 0;
}

.instruction-list li {
    margin-bottom: 12px;
    padding-left: 5px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== КАРТОЧКИ ========== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0 !important;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.card-body {
    padding: 20px;
}

/* ========== СПИСОК ТОВАРОВ ========== */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: #e9ecef;
}

.history-item.active {
    background: #e8eaf6;
    border-left-color: #28a745;
}

.history-price {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.history-copy-btn {
    background: none;
    border: none;
    color: #28a745;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.history-copy-btn:hover {
    background: #28a745;
    color: white;
}

/* ========== ФОРМА ========== */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 12px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ========== КНОПКИ ========== */
.btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    width: 100%;
    transition: transform 0.2s;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-delete {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #dc3545;
    color: white;
}

/* ========== ДЕТАЛИЗАЦИЯ ========== */
.detail-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 15px;
}

.detail-table table {
    margin: 0;
}

.detail-table td, .detail-table th {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.detail-table tr:last-child td {
    border-bottom: none;
}

/* ========== BADGE ========== */
.badge-custom {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* ========== КНОПКА КОПИРОВАНИЯ ========== */
.copy-btn {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #28a745;
    font-weight: 600;
}

.copy-btn:hover {
    background: #28a745;
    color: white;
}

.copy-btn i {
    margin-right: 8px;
}

.copy-btn-copied {
    background: #28a745;
    color: white;
}

/* ========== SEO БЛОК ========== */
.seo-block {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.seo-block h2 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.seo-block h3 {
    color: #764ba2;
    font-size: 1.2rem;
    margin: 20px 0 10px 0;
}

.seo-block p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.seo-block ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.seo-block li {
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.keyword {
    background: #f0f2f5;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #667eea;
}

/* ========== ФУТЕР ========== */
.footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ========== УВЕДОМЛЕНИЯ ========== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== МОБИЛЬНАЯ ВЕРСИЯ ========== */
@media (max-width: 992px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    .logo {
        justify-content: center;
    }
    .logo-icon {
        width: 50px;
        height: 50px;
    }
    .logo-icon svg {
        width: 32px;
        height: 32px;
    }
    .logo-text h1 {
        font-size: 1.6rem;
    }
    .seo-block {
        padding: 20px;
    }
    .seo-block h2 {
        font-size: 1.3rem;
    }
}

/* ========== КНОПКА ЧАТА ========== */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.5s ease;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.chat-button i {
    font-size: 28px;
    color: white;
}

.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========== МОДАЛЬНОЕ ОКНО ЧАТА ========== */
.chat-modal {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--glass-border);
    z-index: 1000;
    animation: slideInUp 0.3s ease;
}

.chat-modal.show {
    display: block;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-modal-content {
    overflow: hidden;
    border-radius: 24px;
}

.chat-modal-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.chat-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
}

.chat-modal-title i {
    font-size: 20px;
    color: var(--primary-light);
}

.chat-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.chat-modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.chat-modal-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.chat-welcome {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar i {
    font-size: 20px;
    color: white;
}

.chat-message-bubble {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
}

.chat-form-group {
    margin-bottom: 16px;
}

.chat-input, .chat-textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.chat-input:focus, .chat-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.chat-textarea {
    resize: none;
    font-family: inherit;
}

.chat-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

.chat-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 12px 20px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.chat-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.chat-modal-footer small {
    color: #94a3b8;
    font-size: 11px;
}

.chat-modal-footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.chat-modal-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .chat-modal {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 80px;
    }

    .chat-button {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .chat-button i {
        font-size: 24px;
    }
}