/* app/static/css/tasks.css */

.tasks-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    animation: fadeIn 0.6s ease-out;
}

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

@media (min-width: 768px) {
    .tasks-container {
        background: var(--bg-white);
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow-md);
        padding: 3rem 2.5rem;
        margin: 2rem auto;
    }
}

.tasks-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tasks-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.tasks-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.access-status-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: slideDown 0.6s ease-out 0.3s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.access-status-badge.paid-access {
    background: #f9fafb;
    color: #374151;
    font-size: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.6s ease-out 0.3s both;
}

.access-status-badge.partial-access {
    background: transparent;
    color: #9ca3af;
    border: none;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.guest-notice {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    margin: 1rem auto;
    max-width: 600px;
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.guest-notice a {
    color: #5b4fe9;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.guest-notice a:hover {
    border-bottom-color: #5b4fe9;
}

.progress-section {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    animation: fadeInScale 0.6s ease-out 0.4s both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (min-width: 768px) {
    .progress-section {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
    }
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-text {
    font-size: 1rem;
    color: var(--text-dark);
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.progress-bar-container {
    height: 12px;
    background: var(--bg-light);
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50px;
    box-shadow: 0 0 10px rgba(91, 79, 233, 0.3);
}

/* SVG Map Container */
.mapa-container {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s ease-out 0.2s both;
}

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

@media (min-width: 768px) {
    .mapa-container {
        box-shadow: var(--shadow-sm);
        border: 1px solid #e5e7eb;
    }
}

.mapa-container svg {
    width: 100%;
    height: auto;
    display: block;
}

/* SVG Paths */
#caminho-fundo,
#caminho-progresso {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#caminho-fundo {
    stroke: #E0E0E0;
}

#caminho-progresso {
    stroke: #f59e0b;
    transition: stroke-dashoffset 1s ease-in-out;
}

/* Task Points */
.task-point {
    cursor: pointer;
    transition: filter 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.task-point:hover {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) brightness(1.1);
}

.task-point.not-yet-available {
    cursor: not-allowed;
}

.task-point.locked-future {
    cursor: pointer;
}

/* Task Number Labels */
.task-number-label {
    font-size: 2.8px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    fill: #374151;
    fill-opacity: 0.6;
    pointer-events: none;
    text-anchor: middle;
    letter-spacing: 0.02em;
}

/* Territory Titles */
.territory-title {
    font-size: 3px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    fill: #45505e;
    fill-opacity: 0.55;
    pointer-events: none;
    text-anchor: middle;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Task Tooltip */
.task-tooltip {
    position: absolute;
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px) scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    min-width: 200px;
    max-width: 300px;
}

.task-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.task-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.task-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.task-tooltip-day {
    font-size: 0.75rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-tooltip-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
}

.task-tooltip-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 6px;
}

.task-tooltip-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.task-tooltip-status.current {
    background: #fef3c7;
    color: #92400e;
}

.task-tooltip-status.locked {
    background: #fee2e2;
    color: #991b1b;
}

.task-tooltip-status.not-available {
    background: #f3f4f6;
    color: #6b7280;
}

.task-tooltip-status.accessible {
    background: #dbeafe;
    color: #1e40af;
}

/* Completion Dialog */
.completion-dialog {
    max-width: 500px;
}

.completion-dialog-title {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin: 0;
    text-align: center;
}

.completion-dialog-message {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
    text-align: center;
    margin: 0;
}

/* Task Dialog */
.task-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}

.task-dialog-overlay.active {
    display: flex;
    opacity: 1;
    backdrop-filter: blur(4px);
}

.task-dialog {
    background: white;
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-dialog-overlay.active .task-dialog {
    transform: scale(1) translateY(0);
}

.task-dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    z-index: 10;
}

.task-dialog-close:hover {
    color: #374151;
}

.task-dialog-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid #f3f4f6;
    position: relative;
    z-index: 1;
}

.task-dialog-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
    margin-bottom: 1rem;
}

.task-dialog-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

.task-dialog-body {
    padding: 2rem;
}

.task-dialog-intro {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.task-dialog-objectives {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.task-dialog-objectives li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    color: var(--text-light);
    line-height: 1.6;
}

.task-dialog-objectives li:before {
    content: "▸";
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.task-dialog-actions {
    border-top: 2px solid #f3f4f6;
    padding-top: 1.5rem;
}

.complete-task-button {
    display: inline-block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.complete-task-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.complete-task-button:hover::before {
    width: 300px;
    height: 300px;
}

.complete-task-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #059669, #047857);
}

.task-checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--border-radius-md);
    transition: background 0.2s ease;
}

.task-checkbox-container:hover {
    background: #f3f4f6;
}

.task-dialog-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.task-checkbox-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.unlock-button-dialog {
    display: inline-block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    cursor: pointer;
}

.unlock-button-dialog:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.not-available-message {
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--border-radius-md);
    color: #6b7280;
    font-style: italic;
}

.unlock-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    cursor: pointer;
}

.unlock-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.completion-message {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    margin-top: 2rem;
    box-shadow: var(--shadow-lg);
    animation: celebrationPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes celebrationPop {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.completion-message h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.completion-message p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Task Input Fields */
.task-input-group {
    margin: 1.5rem 0;
}

.task-input-label {
    display: block;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.task-input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #333;
    background-color: #fafafa;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.task-input-field:focus {
    outline: none;
    border-color: #4A90E2;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.task-input-field::placeholder {
    color: #999;
    font-style: italic;
}

.task-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.task-checkbox-label:hover {
    background-color: #f5f5f5;
}

.task-checkbox-field {
    margin-right: 0.75rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.task-checkbox-label span {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .tasks-header h1 {
        font-size: 2rem;
    }

    .tasks-subtitle {
        font-size: 1rem;
    }

    .mapa-container {

    }

    .task-dialog-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .task-dialog-body {
        padding: 1.5rem;
    }

    .task-dialog-title {
        font-size: 1.25rem;
    }
}