/**
 * Стили для страницы заданий
 */

/* === Основная структура страницы заданий === */
.tasks-page-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.tasks-page-header {
    margin-bottom: 2rem;
}

.tasks-page-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tasks-page-description {
    color: #9ca3af;
}

/* === Разметка контента === */
.tasks-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .tasks-content {
        grid-template-columns: 1fr 400px;
        gap: 2rem;
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .tasks-content {
        grid-template-columns: 1fr 420px;
        gap: 2.5rem;
    }
}

/* === Основной контейнер с заданиями === */
.tasks-main-container {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tasks-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.tasks-filter {
    display: flex;
    align-items: center;
}

.tasks-sort-dropdown {
    background-color: #333333;
    color: #d1d5db;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
}

.tasks-sort-dropdown:focus {
    outline: none;
    ring: 1px #4a90e2;
}

/* Список заданий */
.tasks-list {
    min-height: 4rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .tasks-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1200px) {
    .tasks-list {
        grid-template-columns: 1fr;
    }
}

.tasks-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    min-height: 4rem;
}

.tasks-loading-item {
    height: 8rem;
    background-color: #333333;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.tasks-loading-item:last-child {
    margin-bottom: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.tasks-empty {
    padding: 1rem 0;
    text-align: center;
    min-height: auto;
}

.tasks-empty-icon {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.tasks-empty-message {
    color: #9ca3af;
}

.tasks-pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

/* === Боковая панель === */
.tasks-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Мои подписки */
.subscriptions-container {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.subscriptions-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.subscriptions-list {
    min-height: 8rem;
}

.subscriptions-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.subscriptions-loading-item {
    height: 5rem;
    background-color: #333333;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
}

.subscriptions-loading-item:last-child {
    margin-bottom: 0;
}

.subscriptions-empty {
    padding: 1rem 0;
    text-align: center;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 8rem;
}

.subscriptions-empty-message {
    margin: 0;
}

/* Инструкции */
.instructions-container {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.instructions-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.instructions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
}

.instruction-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background-color: #4a90e2;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.instruction-content {
    flex: 1;
}

.instruction-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.instruction-description {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* === Карточка задания === */
.task-card {
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.task-card:last-child {
    margin-bottom: 0;
}

.task-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.task-card-channel-avatar {
    width: 3rem;
    height: 3rem;
    background-color: #252525;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-card-channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-card-channel-avatar i {
    font-size: 1.5rem;
    color: #4a90e2;
}

.task-card-channel-info {
    flex: 1;
}

.task-card-channel-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.task-card-channel-username {
    font-size: 0.875rem;
    color: #4a90e2;
}

.task-card-points {
    background-color: #252525;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.task-card-points-value {
    font-weight: 600;
    color: #ffc107;
    margin-right: 0.25rem;
}

.task-card-points-icon {
    color: #ffc107;
}

.task-card-body {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.task-card-progress {
    flex: 1;
}

.task-card-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.task-card-progress-bar {
    height: 0.5rem;
    background-color: #252525;
    border-radius: 0.25rem;
    overflow: hidden;
}

.task-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
}

.task-card-created {
    margin-left: 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.task-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-card-subscribe-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.task-card-subscribe-button:hover {
    background-color: #3b82f6;
}

.task-card-subscribe-button i {
    margin-right: 0.5rem;
}

.task-card-verify-button {
    background-color: #10b981;
    color: white;
}

.task-card-verify-button:hover {
    background-color: #059669;
}

.task-card-status {
    font-size: 0.875rem;
    color: #9ca3af;
}

.task-card-completed-label {
    color: #10b981;
    display: flex;
    align-items: center;
}

.task-card-completed-label i {
    margin-right: 0.25rem;
}

/* === Пагинация === */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-item {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333333;
    color: #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pagination-item:hover {
    background-color: #3a3a3a;
}

.pagination-item.active {
    background-color: #4a90e2;
    color: white;
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Карточка подписки === */
.subscription-card {
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.subscription-card:last-child {
    margin-bottom: 0;
}

.subscription-channel-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #252525;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 0.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subscription-channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subscription-channel-avatar i {
    font-size: 1.25rem;
    color: #4a90e2;
}

.subscription-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    margin-right: 0.5rem;
}

.subscription-channel-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subscription-status {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.subscription-status.verified {
    color: #10b981;
}

.subscription-status.pending {
    color: #f59e0b;
}

.subscription-status i {
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.subscription-date {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* === Модальные окна === */
.task-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 32rem;
    width: 100%;
    margin: 0 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f9fafb;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-button-cancel {
    background-color: transparent;
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-button-cancel:hover {
    background-color: #3a3a3a;
}

.modal-button-action {
    background-color: #4a90e2;
    color: white;
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-button-action:hover {
    background-color: #3b82f6;
}

.modal-button-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Предпросмотр канала в модальном окне */
.channel-preview {
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.channel-preview-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.channel-preview-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #333333;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 0.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-preview-avatar i {
    font-size: 1.25rem;
    color: #4a90e2;
}

.channel-preview-info {
    flex: 1;
}

.channel-preview-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.channel-preview-username {
    font-size: 0.875rem;
    color: #4a90e2;
    text-decoration: none;
}

.channel-preview-username:hover {
    text-decoration: underline;
}

.channel-preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-preview-points {
    color: #ffc107;
    font-weight: 500;
}

.channel-preview-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.channel-preview-button:hover {
    background-color: #3b82f6;
    color: white;
    text-decoration: none;
}

/* Подтверждение подписки */
.subscription-confirmation {
    display: flex;
    align-items: center;
    margin-top: 1rem;
}

.subscription-confirmation-checkbox {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(156, 163, 175, 0.2) #4a90e2;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    position: relative;
    background-color: #252525;
}

.subscription-confirmation-checkbox:checked {
    background-color: #4a90e2;
}

.subscription-confirmation-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 0.25rem;
    left: 0.375rem;
    width: 0.25rem;
    height: 0.5rem;
    border: solid rgba(156, 163, 175, 0.2);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.subscription-confirmation-label {
    font-size: 0.875rem;
    color: #d1d5db;
    cursor: pointer;
}

/* === Анимации === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(1rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.task-card {
    animation: fadeIn 0.3s ease-out, slideInUp 0.3s ease-out;
}

.subscription-card {
    animation: fadeIn 0.3s ease-out, slideInUp 0.3s ease-out;
}

/* === Стили для пагинации === */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

.pagination-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #2a2a2a;
    color: #d1d5db;
    border-radius: 0.25rem;
    margin: 0 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.pagination-button:hover {
    background-color: #333333;
}

.pagination-button.active {
    background-color: #4a90e2;
    color: white;
}

.pagination-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}