/* ══════════════════════════════════════════════════════════════════
   ÚKOLY MODULE — Radim Branding v1.0
   Barvy: teal #5BA8A0, coral #F07D7E, bg #f8fafa
   Pro seniory: velké touch targets, jasné ikony, čitelné fonty
   ══════════════════════════════════════════════════════════════════ */

/* ─── CONTAINER ─── */
.tasks-module {
    padding: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.tasks-module h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 16px;
}

/* ─── STATS BAR ─── */
.tasks-stats-bar {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #1a4a45, #0f2d2a);
    padding: 20px;
    border-radius: 16px;
    color: #ffffff;
    margin-bottom: 20px;
}

.tasks-stats-bar .stat-item {
    text-align: center;
}

.tasks-stats-bar .stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

.tasks-stats-bar .stat-value {
    font-size: 2rem;
    font-weight: 800;
    display: block;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.tasks-stats-bar .stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
}

/* ─── ADD TASK BUTTON ─── */
.tasks-add-btn {
    width: 100%;
    padding: 16px;
    background: #5BA8A0;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 3px 12px rgba(91, 168, 160, 0.3);
}

.tasks-add-btn:hover {
    background: #4a9990;
    box-shadow: 0 5px 20px rgba(91, 168, 160, 0.4);
}

.tasks-add-btn:active {
    transform: scale(0.98);
}

/* ─── SECTION HEADERS ─── */
.tasks-section {
    margin-bottom: 20px;
}

.tasks-section h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tasks-section.overdue h4 {
    color: #e53e3e;
}

.tasks-empty {
    text-align: center;
    padding: 32px 20px;
    color: #a0aec0;
    font-size: 1rem;
    color: #a0aec0;
    background: #f8fafa;
    border-radius: 12px;
}

/* ─── TASK CARD ─── */
.task-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.task-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.task-card.completed {
    opacity: 0.75;
    background: #f7fafc;
}

.task-card.overdue {
    border-left: 4px solid #fc8181;
}

/* ─── CHECKBOX ─── */
.task-checkbox {
    width: 44px;
    height: 44px;
    border: 3px solid #5BA8A0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    color: transparent;
    -webkit-tap-highlight-color: transparent;
}

.task-checkbox:hover {
    background: #f0fdfa;
}

.task-checkbox.checked {
    background: #5BA8A0;
    border-color: #5BA8A0;
    color: white;
}

/* ─── TASK INFO ─── */
.task-info {
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.task-title {
    font-weight: 600;
    font-size: 1rem;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-card.completed .task-title {
    text-decoration: line-through;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.task-category {
    font-size: 0.8rem;
    color: white;
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 600;
}

.task-due {
    font-size: 0.85rem;
    color: #718096;
}

.task-due.overdue {
    color: #e53e3e;
    font-weight: 700;
}

.task-repeat {
    font-size: 0.85rem;
    color: #5BA8A0;
    font-weight: 500;
}

.task-menu-btn {
    background: none;
    border: 1px solid #e2e8f0;
    font-size: 1.3rem;
    cursor: pointer;
    color: #718096;
    padding: 8px 10px;
    border-radius: 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.task-menu-btn:hover {
    background: #f0f4f4;
}

/* ─── QUICK TEMPLATES ─── */
.quick-templates {
    margin-top: 20px;
}

.quick-templates h4 {
    margin-bottom: 10px;
    color: #2d3748;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.template-btn {
    padding: 12px 10px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.template-btn:hover {
    border-color: #5BA8A0;
    background: #f0fdfa;
}

/* ─── ADD TASK FORM ─── */
.add-task-form {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-header .back-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #5BA8A0;
    font-weight: 600;
}

.form-header h3 {
    font-size: 1.2rem;
    color: #2d3748;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #718096;
    margin-bottom: 6px;
}

.task-input,
.task-textarea,
.task-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.task-input:focus,
.task-textarea:focus,
.task-select:focus {
    outline: none;
    border-color: #5BA8A0;
}

.task-textarea {
    resize: vertical;
    min-height: 60px;
}

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

/* ─── CATEGORY SELECT ─── */
.category-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-btn {
    padding: 8px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.category-btn.selected {
    border-color: #5BA8A0;
    background: #f0fdfa;
    font-weight: 600;
}

/* ─── PRIORITY SELECT ─── */
.priority-select {
    display: flex;
    gap: 8px;
}

.priority-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.2s;
}

.priority-btn.selected {
    font-weight: 700;
}

.priority-btn.low.selected { border-color: #48bb78; background: #f0fff4; }
.priority-btn.normal.selected { border-color: #4299e1; background: #ebf8ff; }
.priority-btn.high.selected { border-color: #fc8181; background: #fff5f5; }

/* ─── FORM ACTIONS ─── */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .primary {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #5BA8A0, #4A9690);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
}

.form-actions .primary:hover {
    box-shadow: 0 4px 12px rgba(91, 168, 160, 0.3);
}

.form-actions .secondary {
    padding: 14px 20px;
    background: white;
    color: #718096;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
}

/* ─── TASK DETAIL ─── */
.task-detail {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.task-detail h3 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f4f4;
    font-size: 0.9rem;
}

.detail-label {
    color: #718096;
    min-width: 100px;
    font-weight: 600;
}

/* ─── TASK MENU ─── */
.task-menu {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 6px;
    z-index: 100;
}

.task-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
}

.task-menu button:hover {
    background: #f0fdfa;
}

.task-menu button.danger:hover {
    background: #fff5f5;
    color: #e53e3e;
}

/* ─── TOAST ─── */
.task-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2d3748;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    font-weight: 600;
}

.task-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── NOTIFICATION ─── */
.task-notification {
    position: fixed;
    top: 80px;
    right: 16px;
    background: white;
    border: 2px solid #5BA8A0;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1100;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
    max-width: 300px;
}

.task-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #a0aec0;
}

/* ─── CHECKBOX LABEL ─── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #5BA8A0;
}

/* ─── SHOW MORE ─── */
.show-more-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
    color: #5BA8A0;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 8px;
}

.show-more-btn:hover {
    background: #f0fdfa;
}

/* ─── MOBILE ─── */
@media (max-width: 1024px) {
    .tasks-module { padding: 8px; }
    .tasks-stats-bar { flex-direction: row; padding: 14px; gap: 8px; }
    .tasks-stats-bar .stat-value { font-size: 1.4rem; }
    .task-card { padding: 12px; gap: 10px; }
    .task-checkbox { width: 40px; height: 40px; }
    .form-row { grid-template-columns: 1fr; }
    .priority-select { flex-direction: column; }
    .category-select { gap: 6px; }
    .category-btn { padding: 6px 10px; font-size: 0.8rem; }
    .templates-grid { grid-template-columns: repeat(2, 1fr); }
    .template-btn { padding: 10px 8px; font-size: 0.85rem; }
    .form-actions { flex-direction: column; }
    .form-actions .primary, .form-actions .secondary { width: 100%; }
}

/* ─── SENIOR ENHANCEMENTS ─── */

/* Section headers (Dnes, Nadcházející, Splněné) */
.tasks-section-header {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 20px 0 10px;
    padding: 0 0 6px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Overdue section highlight */
.tasks-section-header.overdue {
    color: #e53e3e;
    border-bottom-color: #fed7d7;
}

/* Empty state */
.tasks-empty-state {
    text-align: center;
    padding: 32px 20px;
    color: #a0aec0;
    font-size: 0.95rem;
    background: #f7fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 14px;
}

/* Quick add button — prominent */
.tasks-quick-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: #5BA8A0;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 16px;
    min-height: 52px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.tasks-quick-add:hover { background: #4a9990; }
.tasks-quick-add:active { transform: scale(0.98); }

/* Task title — bigger for readability */
.task-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Task description in detail view */
.task-description {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    margin-top: 6px;
}

/* Priority badges — larger */
.task-priority-badge {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 600;
}
.task-priority-badge.high { background: #fff5f5; color: #e53e3e; }
.task-priority-badge.normal { background: #ebf8ff; color: #4299e1; }
.task-priority-badge.low { background: #f0fff4; color: #48bb78; }

/* Stats numbers */
.tasks-stats-bar .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}
.tasks-stats-bar .stat-label {
    font-size: 0.82rem;
    opacity: 0.9;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .task-title { font-size: 1rem; }
    .task-category { font-size: 0.75rem; padding: 2px 8px; }
    .task-due, .task-repeat { font-size: 0.8rem; }
    .tasks-quick-add { font-size: 1rem; padding: 14px; }
}
