/* Модальное окно для отправки webhook */
.webhook-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.webhook-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.webhook-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.webhook-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.webhook-modal-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.webhook-modal-header .close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.webhook-modal-body {
    padding: 20px;
}

.webhook-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.webhook-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #555;
}

.webhook-info strong {
    color: #333;
    font-weight: 600;
}

.webhook-form {
    margin-bottom: 20px;
}

.webhook-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.webhook-form .hint {
    display: block;
    font-size: 12px;
    color: #999;
    font-weight: normal;
    margin-top: 4px;
}

.webhook-form input[type="text"],
.webhook-form select.adapter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.webhook-form input[type="text"] {
    font-family: 'Courier New', monospace;
}

.webhook-form select.adapter-select {
    cursor: pointer;
    background-color: white;
}

.webhook-form input[type="text"]:focus,
.webhook-form select.adapter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.no-adapters-warning {
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
}

.no-adapters-warning a {
    color: #0056b3;
    text-decoration: underline;
}

.webhook-url {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.webhook-url small {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.webhook-url code {
    display: block;
    font-size: 12px;
    color: #007bff;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.webhook-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    justify-content: center;
}

.webhook-modal-footer button {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Кнопка отправки в AI в списке записей */
.send-ai-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
}

.send-ai-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Темная тема для Telegram */
body.dark-theme .webhook-modal {
    background: #1e1e1e;
    color: #e0e0e0;
}

body.dark-theme .webhook-modal-header {
    border-bottom-color: #333;
}

body.dark-theme .webhook-modal-header h3 {
    color: #e0e0e0;
}

body.dark-theme .webhook-modal-header .close-btn {
    color: #999;
}

body.dark-theme .webhook-modal-header .close-btn:hover {
    background: #333;
    color: #fff;
}

body.dark-theme .webhook-info {
    background: #2a2a2a;
}

body.dark-theme .webhook-info p {
    color: #b0b0b0;
}

body.dark-theme .webhook-info strong {
    color: #e0e0e0;
}

body.dark-theme .webhook-form input[type="text"] {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-theme .webhook-form input[type="text"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body.dark-theme .webhook-url {
    background: #2a2a2a;
}

body.dark-theme .webhook-url small {
    color: #999;
}

body.dark-theme .webhook-url code {
    color: #667eea;
}

body.dark-theme .webhook-modal-footer {
    border-top-color: #333;
}

body.dark-theme .btn-secondary {
    background: #333;
    color: #e0e0e0;
}

body.dark-theme .btn-secondary:hover {
    background: #444;
}

/* Кнопки переключения режима prod/test */
.webhook-mode-selector {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.mode-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mode-btn:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.mode-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.mode-btn-prod.active {
    background: #28a745;
    border-color: #28a745;
}

.mode-btn-test.active {
    background: #ffc107;
    border-color: #ffc107;
    color: #333;
}

/* Темная тема для переключателя режима */
body.dark-theme .webhook-mode-selector {
    border-top-color: #333;
}

body.dark-theme .mode-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-theme .mode-btn:hover {
    background: #333;
    border-color: #667eea;
}

body.dark-theme .mode-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

body.dark-theme .mode-btn-prod.active {
    background: #28a745;
    border-color: #28a745;
}

body.dark-theme .mode-btn-test.active {
    background: #ffc107;
    border-color: #ffc107;
    color: #333;
}
