/* =========================================
   1. CSS Variables & Reset
   ========================================= */
:root {
    /* Teal Scale */
    --teal-100: #d3e0e0;
    --teal-200: #a7c1c0;
    --teal-500: #236362;
    --teal-600: #1c4f4e;
    --teal-700: #153b3b;
    --teal-900: #071414;

    /* Orange Scale */
    --orange-100: #ffe4d9;
    --orange-200: #ffc9b4;
    --orange-500: #FE7843;
    --orange-600: #cb6036;

    /* Utility */
    --bg-glass: rgba(255, 255, 255, 0.95);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hard: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.widget-hidden {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Fade-in animation for first-time display */
.widget-fade-in {
    animation: widgetFadeIn 1s ease-out forwards;
}

@keyframes widgetFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   3. Widget Container
   ========================================= */
.widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 300px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    opacity: 1;
    transform: translateY(0);
}

/* Minimized State Class */
.widget-container.minimized {
    transform: translateY(calc(100% - 68px));
    /* Keep only header visible */
}

.widget-card {
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-hard);
    overflow: hidden;
    border: 1px solid var(--teal-200);
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   4. Header
   ========================================= */
.widget-header {
    background-color: var(--teal-500);
    padding: 20px;
    cursor: pointer;
    position: relative;
    color: white;
    transition: background 0.2s;
}

.widget-header:hover {
    background-color: var(--teal-600);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    padding-right: 16px;
    color: white;
}

.toggle-btn svg {
    stroke: var(--teal-200);
    transition: stroke 0.2s;
}

.widget-header:hover .toggle-btn svg {
    stroke: white;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 12px;
    font-size: 12px;
}

.progress-label {
    color: var(--teal-100);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.progress-percent {
    font-family: monospace;
    font-weight: 700;
    font-size: 14px;
}

/* Progress Bar */
.progress-track {
    width: 100%;
    height: 8px;
    background-color: var(--teal-700);
    border-radius: 99px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--orange-500);
    width: 0%;
    transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

/* Shimmer Effect */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* =========================================
   5. Content List
   ========================================= */
.widget-content {
    background: white;
    max-height: 500px;
    /* Open state */
    opacity: 1;
    transition: max-height 0.4s ease-in-out, opacity 0.3s;
    /* ar1 - checklist show */
}

/* Closed State */
.widget-container.minimized .widget-content {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.roadmap-label {
    padding: 16px 20px;
    background-color: rgba(254, 120, 67, 0.1);
    /* Orange-100 with opacity */
    border-bottom: 1px solid var(--teal-100);
    color: var(--teal-600);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.step-item:hover {
    background-color: rgba(211, 224, 224, 0.3);
}

/* Left active border */
.step-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--orange-500);
    opacity: 0;
    transition: opacity 0.2s;
}

.step-item:hover::before {
    opacity: 1;
}

.step-item.completed::before {
    opacity: 0;
}

/* Checkbox */
.custom-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--teal-200);
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: white;
}

.step-item:hover .custom-checkbox {
    border-color: var(--teal-500);
}

.step-item.completed .custom-checkbox {
    background-color: var(--orange-500);
    border-color: var(--orange-500);
    transform: scale(1.1);
}

.checkbox-icon {
    stroke: white;
    stroke-width: 3;
    width: 14px;
    height: 14px;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
}

.step-item.completed .checkbox-icon {
    transform: scale(1);
    opacity: 1;
}

/* Text & Icon */
.step-text-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--teal-600);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.step-action {
    font-size: 14px;
    font-weight: 500;
    color: var(--orange-500);
    /* color: var(--teal-900); */
    AR1 -- checklist */ transition: color 0.3s;
}

.step-item.completed .step-label {
    color: var(--teal-500);
    opacity: 0.6;
}

.step-item.completed .step-action {
    color: var(--teal-500);
    text-decoration: line-through;
    opacity: 0.6;
}

.step-icon {
    color: var(--teal-500);
    opacity: 0.4;
    width: 18px;
    height: 18px;
    transition: opacity 0.3s;
}

.step-item.completed .step-icon {
    color: var(--teal-200);
    opacity: 1;
}

/* =========================================
   6. Celebration Overlay
   ========================================= */
.celebration-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.celebration-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.trophy-icon {
    color: var(--orange-500);
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(-5%);
    }

    50% {
        transform: translateY(5%);
    }
}

/* Success Footer */
.success-footer {
    padding: 20px;
    text-align: center;
    background-color: rgba(254, 120, 67, 0.15);
    color: var(--teal-600);
    font-size: 14px;
    font-weight: 600;
    display: none;
    /* Hidden by default */
}

.success-footer.visible {
    display: block;
}

/* SVG Utilities */
.widget-container svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}