.journey-container {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.journey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 16px;
}

.journey-header h3 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.5rem;
}

.streak-badge {
    background: #fff9e6;
    border: 2px solid #ffc107;
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-icon {
    font-size: 1.2rem;
}

.streak-count {
    font-weight: 800;
    color: #ff9800;
    font-size: 1.2rem;
}

.streak-label {
    color: #666;
    font-size: 0.9rem;
}

.journey-streak-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.streak-day {
    aspect-ratio: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    padding: 8px;
    text-align: center;
}

.day-label {
    font-size: 0.9rem;
    font-weight: 800;
    display: block;
}

.day-date {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 4px;
    display: block;
}

.streak-day.completed {
    background: #eefbee;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.streak-day.pending {
    background: #f8f8f8;
    border: 2px dashed #ddd;
    color: #999;
}

.streak-day.today {
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.4);
    transform: scale(1.05);
}

.journey-form textarea {
    width: 100%;
    min-height: 120px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    padding: 16px;
    font-size: 1rem;
    transition: border-color 0.3s;
    margin-top: 8px;
}

.journey-form textarea:focus {
    border-color: #4caf50;
    outline: none;
}

.journey-submit-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 16px;
    font-size: 1.1rem;
    box-shadow: 0 4px 0 #388e3c;
    transition: all 0.1s;
}

.journey-submit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #388e3c;
}

.journey-success-msg {
    text-align: center;
    padding: 20px;
    background: #f1f8e9;
    border-radius: 12px;
    color: #2e7d32;
    font-weight: 600;
}

.journey-resubmit-btn {
    background: transparent;
    color: #ff9800;
    border: 2px solid #ff9800;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    transition: all 0.2s;
}

.journey-resubmit-btn:hover {
    background: #ff9800;
    color: white;
}

/* Timeline */
.journey-results-container {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.journey-timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid #e0e0e0;
    margin-top: 20px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #4caf50;
}

.timeline-date {
    font-weight: 800;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 4px;
}

.timeline-content {
    background: #f9f9f9;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #eee;
}

/* Results Table */
.journey-results-all {
    margin-top: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
}

.journey-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* smooth scroll on iOS */
    /* scroll hint: shadow on the right shows there's more to see */
    background:
        linear-gradient(to right, #fff 20px, transparent 20px),
        linear-gradient(to left, #fff 20px, transparent 20px) right,
        radial-gradient(ellipse at left, rgba(0, 0, 0, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse at right, rgba(0, 0, 0, 0.12) 0%, transparent 70%) right;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
    border-radius: 8px;
}

.journey-results-table {
    width: max-content;
    /* expand to fit ALL content, never shrink */
    min-width: 100%;
    /* but at least fill container on wide screens */
    border-collapse: collapse;
    margin-top: 15px;
}

.journey-results-table th {
    text-align: left;
    background: #f8f9fa;
    padding: 12px 14px;
    border-bottom: 2px solid #eee;
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
    /* header text never wraps */
    position: sticky;
    /* keep headers visible on vertical scroll */
    top: 0;
    z-index: 1;
}

.journey-results-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    white-space: nowrap;
    /* prevent all cells from wrapping by default */
}

/* Allow content cells to wrap since they can be long */
.journey-results-table td.content-cell {
    white-space: normal;
    max-width: 300px;
}

/* Fixed minimum widths per column */
.journey-results-table th:nth-child(1),
.journey-results-table td:nth-child(1) {
    min-width: 140px;
}

/* Thành viên */

.journey-results-table th:nth-child(2),
.journey-results-table td:nth-child(2) {
    min-width: 110px;
}

/* Ngày bắt đầu */

.journey-results-table th:nth-child(3),
.journey-results-table td:nth-child(3) {
    min-width: 70px;
}

/* Streak */

.journey-results-table th:nth-child(4),
.journey-results-table td:nth-child(4) {
    min-width: 220px;
}

/* Chi tiết dots */

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell img {
    border-radius: 50%;
}

.streak-mini {
    background: #fff9e6;
    color: #ff9800;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid #ffe082;
}

.daily-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 400px;
    /* wider so dots don't wrap too early */
}

.day-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    cursor: help;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.day-dot.done {
    background: #4caf50;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.day-dot.missed {
    background: #e0e0e0;
}

/* Remove old last-child min-width (now handled per-column above) */

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: pre-wrap;
    width: 200px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    margin-bottom: 10px;
    pointer-events: none;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    margin-bottom: -2px;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Submission Animation */
.journey-submitting-overlay {
    position: relative;
    padding: 28px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-radius: 16px;
    text-align: center;
    overflow: hidden;
    margin-bottom: 16px;
}

.journey-submitting-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(76, 175, 80, 0.12) 50%, transparent 100%);
    animation: journey-shimmer 1.5s ease-in-out infinite;
}

@keyframes journey-shimmer {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

.journey-submitting-overlay .journey-submit-icon {
    font-size: 2rem;
    animation: journey-pulse 1s ease-in-out infinite;
    display: block;
    margin-bottom: 8px;
}

@keyframes journey-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

.journey-submitting-overlay p {
    margin: 0;
    color: #2e7d32;
    font-weight: 600;
    font-size: 1rem;
}

/* Timeline new item slide-in */
.timeline-item-new {
    animation: journey-slideIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(-10px);
}

@keyframes journey-slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item-new .timeline-content {
    background: #e8f5e9 !important;
    border-color: #a5d6a7 !important;
}

/* Streak day completed animation */
.streak-day-just-completed {
    animation: journey-pop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

@keyframes journey-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1.05);
    }
}

/* Success message enhanced */
.journey-success-msg-animated {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
    color: #1b5e20;
    font-weight: 600;
    border: 1px solid #a5d6a7;
    animation: journey-slideIn 0.4s ease-out forwards;
    opacity: 0;
    margin-top: 12px;
}

.journey-success-msg-animated .success-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 6px;
}