/* style.css - Стили для визитки */

:root {
    --primary-color: #8B0000;
    --secondary-color: #1a1a1a;
    --background-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #eaeaea;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Загрузка */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Основной контейнер */
#app-container {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Шапка */
.visitka-header {
    background: linear-gradient(135deg, var(--primary-color), #a00000);
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 5px solid rgba(0, 0, 0, 0.1);
}

.visitka-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.visitka-header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* Основной контент */
.visitka-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Информация */
.forge-info {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.forge-info h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 15px;
    margin-top: 3px;
    width: 24px;
}

.info-item strong {
    display: block;
    color: var(--secondary-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.info-item p {
    color: var(--text-light);
    line-height: 1.5;
}

.info-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.info-item a:hover {
    color: #a00000;
    text-decoration: underline;
}

/* Статусы */
.status-active {
    color: var(--success-color);
    font-weight: 600;
}

.status-inactive {
    color: var(--warning-color);
    font-weight: 600;
}

/* Прайс-лист */
.price-section {
    background: var(--card-bg);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    padding: 0; /* убрали внутренние отступы */
}

.price-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding: 20px 20px 0 20px; /* отступы сверху и по бокам, снизу 0 */
}

.price-list {
    display: grid;
    gap: 15px;
}

.price-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.price-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.price-name {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.price-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.price-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Алёрты */
.alert {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert i {
    font-size: 1.5rem;
    margin-right: 15px;
}

.alert strong {
    display: block;
    margin-bottom: 5px;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Ошибки */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.error-icon {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 20px;
}

.error-state h2 {
    color: var(--danger-color);
    margin-bottom: 15px;
}

.error-state p {
    color: var(--text-light);
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    text-decoration: none;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #a00000;
    transform: translateY(-2px);
}

/* Футер */
.footer-note {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}

.footer-note p {
    margin-bottom: 10px;
}

.footer-note .small {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Утилиты */
.text-primary {
    color: var(--primary-color) !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .visitka-header h1 {
        font-size: 2rem;
    }
    
    .visitka-header .subtitle {
        font-size: 1rem;
    }
    
    .visitka-content {
        padding: 15px;
    }
    
    .forge-info,
    .price-section {
        padding: 20px;
    }
    
    .info-item {
        flex-direction: column;
    }
    
    .info-item i {
        margin-bottom: 10px;
        margin-right: 0;
    }
}

/* Стили для карточек процессов */
.process-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    margin-bottom: 15px;
}

.process-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.process-card h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.process-description {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.order-process-btn {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.order-process-btn:hover {
    background: #0056b3;
}

/* Стили для секции процессов */
.processes-section {
    margin-top: 30px;
}

.processes-section h2 {
    color: var(--primary-color, #8B0000);
    margin-bottom: 15px;
}

.processes-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Стили для скролла процессов */
.processes-container::-webkit-scrollbar {
    width: 8px;
}

.processes-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.processes-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.processes-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Стили для модального окна */
.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-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content .process-viewer-container {
    flex: 1;
    overflow: auto;
}

/* Стили для форм (адаптировано из автономного процесса) */
.process-form {
    margin: 0;
    padding: 0;
    width: 100%;
}

.form-field {
    margin-bottom: 12px;
    width: 100%;
}

.form-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.checkbox-wrapper input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 8px 0;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 5px;
}

.form-field.error input,
.form-field.error select,
.form-field.error textarea,
.form-field.error .checkbox-wrapper,
.form-field.error .radio-group {
    border-color: #ef4444;
    background-color: #fff8f8;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.price-items {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.price-items::-webkit-scrollbar {
    width: 8px;
}

.price-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.price-items::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.price-items::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== ТЕМЫ ========== */
/* Тёплая тема (warm) */
body.theme-warm {
    --primary-color: #b45309;      /* оранжево-коричневый */
    --secondary-color: #1a1a1a;
    --background-color: #fdf6e3;   /* кремовый */
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
}

/* Тёмная тема (dark) */
body.theme-dark {
    --primary-color: #f59e0b;      /* золотисто-жёлтый */
    --secondary-color: #ffffff;
    --background-color: #1e293b;   /* глубокий сине-серый */
    --card-bg: #334155;            /* чуть светлее фона для карточек */
    --text-color: #f1f5f9;         /* светлый текст */
    --text-light: #cbd5e1;
    --border-color: #475569;
}

/* Для тёмной темы делаем шапку строгой, без градиента */
body.theme-dark .visitka-header {
    background: #0f172a;
}


/* Полная изоляция чата от тем — всегда светлая тема */
body.theme-warm .guest-chat-window,
body.theme-dark .guest-chat-window,
body.theme-warm [class*="chat"],
body.theme-dark [class*="chat"] {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

body.theme-warm .guest-chat-window .chat-header,
body.theme-dark .guest-chat-window .chat-header,
body.theme-warm [class*="chat-header"],
body.theme-dark [class*="chat-header"] {
    background-color: #4a6fa5 !important;
    color: #ffffff !important;
}

body.theme-warm .guest-chat-window button,
body.theme-dark .guest-chat-window button,
body.theme-warm [class*="chat"] button,
body.theme-dark [class*="chat"] button {
    background-color: #4a6fa5 !important;
    color: #ffffff !important;
}

body.theme-warm .guest-chat-window input,
body.theme-dark .guest-chat-window input,
body.theme-warm [class*="chat"] input,
body.theme-dark [class*="chat"] input {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

/* ---------- РЕЖИМ ВСТРАИВАНИЯ ---------- */
body.embed-mode {
    background: transparent !important;
    min-height: auto;
}

body.embed-mode #loading {
    background: transparent;
}

body.embed-mode .visitka-header {
    display: none !important;
}

body.embed-mode .visitka-content {
    max-width: none;
    padding: 0;
}

body.embed-mode #app-container {
    background: transparent;
}