/**
 * Services Pages Styles
 * Common styles for all service pages: views, subscribers, channels
 */

/* Sidebar sticky */
.sidebar-sticky {
    position: sticky;
    top: 100px;
}
@media (max-width: 1024px) {
    .sidebar-sticky {
        position: static;
    }
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(to right, #51B3F8, #0383c1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-text-orange {
    background: linear-gradient(to right, #fa9700, #fc1700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Services arrow */
.services-arrow {
    transition: transform 0.2s ease;
}
.services-header-card:hover .services-arrow {
    transform: translateX(4px);
}

/* Левая колонка - описание */
.service-desc-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--kt-border-color, #e5e7eb);
    padding: 20px;
}
.service-desc-card h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1f2937;
}
.service-desc-card p {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 12px 0;
}
.service-desc-card ul {
    margin: 0 0 12px 0;
    padding: 0;
    list-style: none;
}
.service-desc-card li {
    position: relative;
    padding-left: 16px;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 6px;
    line-height: 1.5;
}
.service-desc-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    background: #039CE2;
    border-radius: 50%;
}
.service-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #4b5563;
}
.service-badge.primary {
    background: rgba(3, 156, 226, 0.1);
    color: #0288D1;
}
.service-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* Кнопка подробнее */
.btn-read-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin-top: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #6b7280;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-read-more:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}
.btn-read-more i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}
.btn-read-more:hover i {
    transform: translateX(3px);
}

/* Карточка контента */
.content-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--kt-border-color, #e5e7eb);
    overflow: visible;
}

/* Секция заголовок */
.section-header {
    padding: 24px;
    border-bottom: 1px solid #f3f4f6;
    overflow: visible;
}
.section-header h5 {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 4px 0;
    color: #1f2937;
}
.section-header p {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Форма калькулятора */
.calc-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 24px;
    overflow: visible;
}
@media (max-width: 640px) {
    .calc-form {
        grid-template-columns: 1fr;
    }
    .calc-form .form-group.col-full > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
}
.form-group.col-full {
    grid-column: 1 / -1;
}
.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: visible;
}

/* Tooltip */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.tooltip-wrapper .tooltip-icon {
    color: #9ca3af;
    font-size: 1rem;
    transition: color 0.15s ease;
}
.tooltip-wrapper:hover .tooltip-icon {
    color: #6b7280;
}
.tooltip-wrapper .kt-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #1f2937;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal;
    max-width: 220px;
    text-align: left;
    line-height: 1.4;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.tooltip-wrapper .kt-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}
.tooltip-wrapper:hover .kt-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Инпуты */
.kt-input, .kt-select {
    padding: 10px 12px;
    font-size: 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    transition: all 0.2s;
}
.kt-input:focus, .kt-select:focus {
    outline: none;
    border-color: #039CE2;
    box-shadow: 0 0 0 3px rgba(3, 156, 226, 0.1);
}
.kt-input:disabled {
    background: var(--muted, #f9fafb);
    color: var(--muted-foreground, #6b7280);
    cursor: not-allowed;
    opacity: 60%;
}
.kt-select {
    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='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.kt-input.invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Input с иконкой */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-icon .input-icon {
    position: absolute;
    right: 12px;
    color: #9ca3af;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.input-with-icon .kt-input {
    padding-right: 36px;
    width: 100%;
}

/* AI сообщение */
.ai-wrapper {
    grid-column: 1 / -1;
}
.ai-message {
    font-size: 0.8125rem;
    color: #6b7280;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}
.ai-message .ai-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: -1px;
}
.ai-message.success { color: #5cb85c; }
.ai-message.warning { color: #f59e0b; }
.ai-message.error { color: #ef4444; }

/* Блок бонуса / переключатель */
.bonus-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px solid transparent;
}
.bonus-block .toggle-content {
    flex: 1;
}
.bonus-block .toggle-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}
.bonus-block .toggle-desc {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #039CE2;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Toggle зелёный вариант */
.toggle-switch.toggle-green input:checked + .toggle-slider {
    background-color: #22c55e;
}

/* Кнопка заказа */
.form-footer {
    grid-column: 1 / -1;
    margin-left: -24px;
    margin-right: -24px;
    margin-top: 10px;
}
.btn-order {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #22c55e;
    background: #f9fafb;
    border: none;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 10px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-order:hover:not(.disabled) {
    background: #f3f4f6;
    color: #16a34a;
}
.btn-order.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-order.loading {
    pointer-events: none;
}
.btn-order .btn-spinner {
    animation: spin 0.75s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.btn-order i {
    transition: transform 0.2s;
}
.btn-order:hover:not(.disabled) i {
    transform: translateX(3px);
}

/* Переключатель страховки (channel.php) */
.insurance-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.insurance-toggle:hover {
    background: #f3f4f6;
}
.insurance-toggle.active {
    background: rgba(34, 197, 94, 0.08);
    border-color: transparent;
}
.insurance-toggle .toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    transition: all 0.3s;
    flex-shrink: 0;
    margin-left: auto;
    margin-top: 2px;
}
.insurance-toggle .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.insurance-toggle.active .toggle-switch {
    background: #22c55e;
}
.insurance-toggle.active .toggle-switch::after {
    left: 18px;
}

/* Итоговая цена (channel.php) */
.price-summary {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
}
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 6px;
}
.price-row:last-child {
    margin-bottom: 0;
}
.price-row.total {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px dashed #d1d5db;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}
.price-row .discount { color: #22c55e; }
.price-value { font-weight: 500; }
.price-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-right: 6px;
}

/* Ошибки полей */
.field-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 4px;
    min-height: 18px;
}
