/**
 * Tasks Page Styles
 * Modern task management UI following latest design trends
 */

/* ============================================================================
   PAGE LAYOUT
   ============================================================================ */

.page-header,
.task-stats-container,
.task-filters-container,
.tasks-list-container {
    padding-left: 32px;
    padding-right: 32px;
}

/* ============================================================================
   TASK STATISTICS
   ============================================================================ */

.task-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.task-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #49ab7c;
}

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

.task-stat-card.overdue {
    border-left-color: #ef4444;
}

.task-stat-card.today {
    border-left-color: #f59e0b;
}

.task-stat-card.this-week {
    border-left-color: #3b82f6;
}

.task-stat-card.completed {
    border-left-color: #10b981;
}

.task-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-stat-icon {
    font-size: 20px;
    opacity: 0.6;
}

.task-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

/* ============================================================================
   FILTERS
   ============================================================================ */

.task-filters-container {
    background: white;
    border-radius: 0;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 200px 220px 1fr auto;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.filter-group label i {
    font-size: 14px;
    color: #49ab7c;
}

.filter-group .form-control {
    height: 42px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.filter-group .form-control:focus {
    outline: none;
    border-color: #49ab7c;
    background: white;
    box-shadow: 0 0 0 3px rgba(73, 171, 124, 0.1);
}

.filter-group .form-control::placeholder {
    color: #9ca3af;
}

#clearFiltersBtn {
    height: 42px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

#clearFiltersBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   TASKS LIST
   ============================================================================ */

.tasks-list-container {
    background: white;
    border-radius: 0;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.task-section {
    margin-bottom: 32px;
}

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

.task-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.task-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.task-section-icon.overdue {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.task-section-icon.today {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.task-section-icon.this-week {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.task-section-icon.later {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.task-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.task-section-count {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================================
   TASK CARD
   ============================================================================ */

.task-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #49ab7c;
    transition: width 0.2s ease;
}

.task-card.status-késésben::before {
    background: #ef4444;
}

.task-card.status-kész::before {
    background: #10b981;
}

.task-card.status-kész {
    opacity: 0.7;
}

.task-card:hover {
    background: white;
    border-color: #49ab7c;
    box-shadow: 0 4px 12px rgba(73, 171, 124, 0.15);
    transform: translateX(4px);
}

.task-card:hover::before {
    width: 6px;
}

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

.task-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.task-card.status-kész .task-card-title {
    text-decoration: line-through;
    color: #6b7280;
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6b7280;
}

.task-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-card-meta-item i {
    font-size: 12px;
}

.task-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.task-card-actions .btn {
    font-size: 13px;
    padding: 6px 12px;
}

/* ============================================================================
   PRIORITY BADGES
   ============================================================================ */

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-badge.low {
    background: #dbeafe;
    color: #1e40af;
}

.priority-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-badge.high {
    background: #fed7aa;
    color: #9a3412;
}

.priority-badge.urgent {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================================================
   CATEGORY BADGES
   ============================================================================ */

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge i {
    font-size: 10px;
}

/* Category Selector Wrapper */
.category-selector-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.category-selector-wrapper select {
    flex: 1;
}

.category-selector-wrapper .btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    color: #6b7280;
    transition: all 0.2s;
}

.category-selector-wrapper .btn-icon:hover {
    background: #49ab7c;
    border-color: #49ab7c;
    color: white;
}

/* Category Management Modal */
.category-add-form {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 2px solid #e5e7eb;
}

.category-form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.color-picker {
    height: 44px;
    padding: 4px;
    cursor: pointer;
}

.category-list-section {
    margin-top: 24px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.category-item:hover {
    border-color: #49ab7c;
    box-shadow: 0 2px 4px rgba(73, 171, 124, 0.1);
}

.category-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.category-color-preview {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
}

.category-item-name {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.category-item-actions {
    display: flex;
    gap: 8px;
}

.category-item-actions .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.category-item-actions .btn-icon.btn-edit {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    color: #3b82f6;
}

.category-item-actions .btn-icon.btn-edit:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.category-item-actions .btn-icon.btn-delete {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #dc2626;
}

.category-item-actions .btn-icon.btn-delete:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.category-item.editing {
    background: #f0fdf4;
    border-color: #49ab7c;
}

.category-edit-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.category-edit-form input[type="text"] {
    flex: 1;
    height: 36px;
    font-size: 14px;
}

.category-edit-form input[type="color"] {
    width: 80px;
    height: 36px;
    padding: 2px;
}

.category-edit-actions {
    display: flex;
    gap: 8px;
}

.category-edit-actions .btn {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

/* Notification Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================================================
   STATUS BADGES
   ============================================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.nyitott {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.késésben {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.kész {
    background: #d1fae5;
    color: #065f46;
}

.status-badge i {
    font-size: 10px;
}

/* ============================================================================
   TASK DETAIL MODAL
   ============================================================================ */

.task-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.task-detail-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.task-detail-sidebar {
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
}

.task-detail-section {
    margin-bottom: 20px;
}

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

.task-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.task-detail-value {
    font-size: 14px;
    color: #111827;
    line-height: 1.6;
}

.task-detail-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.task-detail-description {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

.task-detail-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.task-detail-info-row:last-child {
    border-bottom: none;
}

.task-detail-info-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #49ab7c;
    font-size: 14px;
}

.task-detail-info-content {
    flex: 1;
}

.task-detail-info-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 2px;
}

.task-detail-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.task-related-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #49ab7c;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.task-related-link:hover {
    color: #3d8f67;
    text-decoration: underline;
}

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

.tasks-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.tasks-empty-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.tasks-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 8px 0;
}

.tasks-empty-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.tasks-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.tasks-loading i {
    font-size: 48px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .task-filters-container {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    #clearFiltersBtn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .page-header,
    .task-stats-container,
    .task-filters-container,
    .tasks-list-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .task-stats-container {
        grid-template-columns: 1fr;
    }

    .task-filters-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .filter-group {
        width: 100%;
    }

    #clearFiltersBtn {
        grid-column: 1;
    }

    .task-detail-grid {
        grid-template-columns: 1fr;
    }

    .task-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .task-card-actions {
        flex-direction: column;
    }

    .task-card-actions .btn {
        width: 100%;
    }

    .category-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .category-form-row .form-group {
        width: 100% !important;
    }

    .category-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .category-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .category-edit-form {
        flex-direction: column;
    }

    .category-edit-form input[type="color"] {
        width: 100%;
    }
}

/* ============================================================================
   FORM ENHANCEMENTS
   ============================================================================ */

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

.form-row .form-group.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group .form-control {
    height: 44px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-group .form-control:focus {
    outline: none;
    border-color: #49ab7c;
    box-shadow: 0 0 0 3px rgba(73, 171, 124, 0.1);
}

.form-group textarea.form-control {
    height: auto;
    padding: 12px 14px;
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-group .form-control::placeholder {
    color: #9ca3af;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

/* Related entity section */
.related-entity-section {
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.related-entity-section.has-selection {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #49ab7c;
    border-style: solid;
    box-shadow: 0 2px 8px rgba(73, 171, 124, 0.1);
}

.related-entity-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.related-entity-section.has-selection .related-entity-header {
    border-bottom-color: #86efac;
}

.related-entity-header i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #49ab7c;
    color: white;
    border-radius: 8px;
    font-size: 14px;
}

.related-entity-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form group icons */
.form-group label i {
    color: #49ab7c;
    width: 16px;
    text-align: center;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 20px 0;
}

.pagination-container .btn {
    min-width: 100px;
}

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

