/* ===== NEWS TASKS ===== */

.news-task-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.news-task-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.news-task-card.paused {
    opacity: 0.7;
    background: #f9fafb;
}

.news-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.news-task-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-task-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.news-task-status.active {
    background: #d1fae5;
    color: #059669;
}

.news-task-status.paused {
    background: #fef3c7;
    color: #d97706;
}

.news-task-actions {
    display: flex;
    gap: 8px;
}

.news-task-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.news-task-info-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.news-task-info-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 5px;
    font-weight: 500;
}

.news-task-info-value {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.news-task-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-source-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-schedule-days {
    display: flex;
    gap: 5px;
}

.news-day {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
}

.news-day.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.news-target-chats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-chat-tag {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
}

/* ===== NEWS FORM ===== */

.news-form {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.news-form.hidden {
    display: none;
}

.news-form h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.news-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .news-form-grid {
        grid-template-columns: 1fr;
    }
}

.news-form-full {
    grid-column: 1 / -1;
}

.news-form .form-group {
    margin-bottom: 15px;
}

.news-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

.news-form .form-group input,
.news-form .form-group select,
.news-form .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #1f2937;
    font-size: 14px;
    transition: all 0.2s;
}

.news-form .form-group input:focus,
.news-form .form-group select:focus,
.news-form .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.news-form .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.news-form .form-group small {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 12px;
}

/* URL список */
.news-urls-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.news-url-item {
    display: flex;
    gap: 8px;
}

.news-url-item input {
    flex: 1;
}

.news-url-item .btn-remove {
    padding: 10px 14px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.news-url-item .btn-remove:hover {
    background: #fecaca;
}

.btn-add-url {
    padding: 10px 15px;
    background: white;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-add-url:hover {
    border-color: #3498db;
    color: #3498db;
    background: #f0f9ff;
}

/* Дни недели */
.news-days-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.news-day-checkbox {
    display: none;
}
.news-day-label {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
    line-height: 1 !important;
    padding: 0;
    margin: 0;
}
.news-day-label span {
    display: block;
}

.news-day-checkbox:checked + .news-day-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

.news-day-label:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Выбор групп */
.news-chats-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-chat-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.news-chat-checkbox-item:hover {
    background: #f0f9ff;
    border-color: #3498db;
}

.news-chat-checkbox-item input {
    width: auto;
}

.news-chat-checkbox-item span {
    flex: 1;
    color: #374151;
    font-weight: 500;
}

/* Кнопки формы */
.news-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* ===== HISTORY ===== */

.news-history {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.news-history.hidden {
    display: none;
}

.news-history h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.news-post-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.news-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.news-post-date {
    color: #6b7280;
    font-size: 13px;
}

.news-post-status {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.news-post-status.success {
    background: #d1fae5;
    color: #059669;
}

.news-post-status.failed {
    background: #fee2e2;
    color: #dc2626;
}

.news-post-content {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== EMPTY STATE ===== */

.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.news-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.news-empty-text {
    font-size: 16px;
    margin-bottom: 20px;
    color: #6b7280;
}

/* ===== BUTTONS ===== */

.btn-run {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 13px;
}

.btn-run:hover {
    background: #bfdbfe;
}

.btn-edit {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 13px;
}

.btn-edit:hover {
    background: #fde68a;
}

.btn-icon.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon.btn-danger:hover {
    background: #fecaca;
}