/* Iframe-optimized Interactive Checklist Styles */


/* Base font sizing optimized for iframe and older users */

body,
#as-gamified-checklist,
#as-progressbar-phases,
.as-phase-header {
    font-size: 1.1em;
    /* Reduced from 1.25em but still readable */
}


/* Compact progress bar for iframe */

#as-progressbar-wrap {
    width: 100%;
    max-width: 95%;
    /* Increased from 85% to use more space */
    margin: 1em auto 0.8em auto;
    /* Reduced from 2em to 1em */
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

#as-progressbar-label {
    font-size: 1.2em;
    /* Reduced from 1.4em */
    font-weight: bold;
    margin-bottom: 0.3em;
    /* Reduced from 0.5em */
    color: #1976d2;
    text-align: center;
    letter-spacing: 0.5px;
}

#as-progressbar {
    width: 100%;
    height: 16px;
    /* Reduced from 20px */
    background: #e3eafc;
    border-radius: 8px;
    /* Reduced from 10px */
    box-shadow: 0 1px 3px #90caf9bb;
    /* Reduced shadow */
    overflow: hidden;
    position: relative;
}

#as-progressbar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #43a047 0%, #ffb300 90%);
    border-radius: 8px 0 0 8px;
    transition: width 0.7s cubic-bezier(.68, -0.55, .27, 1.55);
}

#as-progressbar-phases {
    display: flex;
    justify-content: space-between;
    margin-top: 0.2em;
    /* Reduced from 0.3em */
    font-size: 0.9em;
    /* Reduced from 1.08em */
    font-weight: 600;
    /* Reduced from 700 */
    color: #274633;
    letter-spacing: 0.3px;
    width: 100%;
    max-width: 100%;
    position: relative;
}

#as-progressbar-phases span {
    min-width: 60px;
    /* Reduced from 80px */
    text-align: center;
    position: relative;
    top: 0.1em;
    padding: 0 1px;
    /* Reduced from 2px */
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 0.85em;
    /* Make phase labels more compact */
}


/* Main container optimized for iframe */

#as-gamified-checklist {
    width: 100%;
    max-width: 98%;
    /* Increased from 85% */
    margin: 1em auto;
    /* Reduced from 2em */
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #fff;
    border-radius: 12px;
    /* Reduced from 16px */
    box-shadow: 0 2px 12px 0 rgba(60, 72, 88, .08);
    /* Reduced shadow */
    padding: 1.2em 1em;
    /* Reduced from 2.2em 2em */
    box-sizing: border-box;
}


/* Compact phase styling */

.as-phase {
    margin-bottom: 0.6em;
    /* Reduced from 1em */
    border-radius: 8px;
    /* Reduced from 10px */
    box-shadow: 0 1px 4px 0 rgba(60, 72, 88, .06);
    /* Reduced shadow */
    background: #f5faff;
    transition: box-shadow 0.2s;
}

.as-phase-header {
    min-height: 40px;
    /* Reduced from 56px */
    padding: 0.8em 1em;
    /* Reduced from 1.2em 1.5em */
    cursor: pointer;
    border: 2px solid #1976d2;
    border-radius: 8px;
    /* Reduced from 10px */
    background: #e3eafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1em;
    /* Reduced from 1.1em */
    font-weight: 600;
    /* Reduced from 700 */
    user-select: none;
    transition: background 0.2s, border 0.2s;
}

.as-phase-header[aria-expanded="true"] {
    background: #c8e6c9;
    border-color: #43a047;
}

.as-phase-toggle {
    font-size: 1.4em;
    /* Reduced from 1.7em */
    margin-left: 0.5em;
    /* Reduced from 1em */
    transition: transform 0.2s;
}

.as-phase.collapsed .as-phase-toggle {
    transform: rotate(-90deg);
}

.as-phase-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.3em;
    /* Reduced from 0.5em */
    display: block;
}

.as-phase.collapsed .as-phase-list {
    display: none;
}


/* Compact step styling */

.as-step {
    display: flex;
    align-items: center;
    background: transparent;
    border-radius: 6px;
    /* Reduced from 8px */
    padding: 0.8em 1em;
    /* Reduced from 1.2em 1.5em */
    margin: 0.1em 0;
    /* Reduced from 0.2em */
    box-shadow: none;
    gap: 0.7em;
    /* Reduced from 1em */
    font-size: 1em;
    /* Reduced from 1.15em */
    min-height: 36px;
    /* Reduced from 48px */
    transition: background 0.3s, transform 0.3s, opacity 0.3s;
}

.as-step.completed {
    background: #e8f5e9;
    opacity: 0.7;
    font-size: 0.95em;
    /* Reduced from 1em */
    text-decoration: line-through;
    transform: scale(0.98);
    /* Reduced from 0.97 */
}

.as-step.completed.animate {
    animation: popShrink 0.4s ease forwards;
}

@keyframes popShrink {
    0% {
        transform: scale(1.05);
        /* Reduced from 1.1 */
        opacity: 1;
    }
    100% {
        transform: scale(0.98);
        /* Reduced from 0.97 */
        opacity: 0.7;
    }
}


/* Compact checkbox styling */

.as-step input[type="checkbox"] {
    accent-color: #43a047;
    width: 1.4em;
    /* Reduced from 2em */
    height: 1.4em;
    /* Reduced from 2em */
    margin-right: 0.7em;
    /* Reduced from 1em */
    flex-shrink: 0;
}

.as-step a {
    color: #1976d2;
    text-decoration: underline;
    cursor: pointer;
    flex: 1;
    transition: color 0.2s;
    word-break: break-word;
    font-size: 0.95em;
    /* Reduced from 1em */
    line-height: 1.3;
    /* Better line height for readability */
}

.as-step a:hover {
    color: #43a047;
}

.as-step .as-step-links {
    display: flex;
    gap: 0.3em;
    /* Reduced from 0.5em */
    flex-wrap: wrap;
}

.as-step .as-step-links a {
    flex: none;
    font-size: 0.8em;
    /* Reduced from 0.9em */
    padding: 0.15em 0.3em;
    /* Reduced from 0.2em 0.4em */
    background: #f0f7ff;
    border-radius: 3px;
    /* Reduced from 4px */
    text-decoration: none;
    border: 1px solid #e3eafc;
}

.as-step .as-step-links a:hover {
    background: #e3eafc;
    border-color: #1976d2;
}


/* Compact tooltip styling */

.as-tooltip {
    position: relative;
    cursor: help;
    font-size: 1em;
    /* Reduced from 1.1em */
    color: #888;
    margin-left: 0.5em;
    /* Reduced from 0.7em */
    flex-shrink: 0;
}

.as-tooltip:hover::after,
.as-tooltip:focus::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: 120%;
    min-width: 160px;
    /* Reduced from 180px */
    background: #1976d2;
    color: #fff;
    padding: 6px 10px;
    /* Reduced from 8px 14px */
    border-radius: 6px;
    /* Reduced from 8px */
    font-size: 0.9em;
    /* Reduced from 1em */
    white-space: pre-line;
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(30, 60, 120, .1);
    /* Reduced shadow */
    pointer-events: none;
}


/* Hide tooltip when info icon is hidden */

.as-tooltip[style*="display: none"] {
    margin-left: 0;
    width: 0;
    overflow: hidden;
}

.as-tooltip[style*="display: none"]:hover::after,
.as-tooltip[style*="display: none"]:focus::after {
    display: none;
}


/* Compact email form styles */

#as-email-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.2em 0 1em 0;
    /* Reduced from 2em 0 1.5em 0 */
    width: 100%;
}

#as-email-form label {
    font-size: 1em;
    /* Reduced from 1.1em */
    margin-bottom: 0.5em;
    /* Reduced from 0.7em */
    color: #1a237e;
    text-align: center;
}

#as-email-form input[type="email"] {
    padding: 0.7em 1em;
    /* Reduced from 0.9em 1.2em */
    border-radius: 6px;
    /* Reduced from 9px */
    border: 2px solid #90caf9;
    font-size: 1em;
    /* Reduced from 1.1em */
    width: 100%;
    max-width: 300px;
    /* Add max width for better iframe display */
    margin-bottom: 0.8em;
    /* Reduced from 1.1em */
    box-sizing: border-box;
    display: block;
}

#as-email-form button {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    /* Reduced from 9px */
    padding: 0.7em 1.5em;
    /* Reduced from 0.9em 2em */
    font-size: 1em;
    /* Reduced from 1.1em */
    cursor: pointer;
    transition: background 0.2s;
}

#as-email-form button:hover {
    background: #1565c0;
}


/* Confetti animation container - keep full viewport */

#as-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    display: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    /* Reduced from 12px */
    height: 10px;
    /* Reduced from 12px */
    background-color: #ffb300;
    opacity: 0.9;
    border-radius: 2px;
    /* Reduced from 3px */
    animation: confetti-fall-celebration 3s forwards;
}

.confetti-emoji {
    position: absolute;
    opacity: 0.9;
    animation: confetti-fall-celebration 4s forwards;
}

@keyframes confetti-fall-celebration {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.9;
    }
    10% {
        transform: translateY(10vh) rotate(180deg) scale(1.1);
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) rotate(720deg) scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(1080deg) scale(0.6);
        opacity: 0;
    }
}

@keyframes celebration-text {
    0% {
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translateX(-50%) scale(1.2);
        opacity: 1;
    }
    30% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    70% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0;
    }
}


/* Enhanced confetti effects */

.confetti-piece.gold {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
    /* Reduced shadow */
}

.confetti-piece.silver {
    background: linear-gradient(45deg, #C0C0C0, #E6E6E6);
    box-shadow: 0 0 4px rgba(192, 192, 192, 0.6);
    /* Reduced shadow */
}

.confetti-piece.rainbow {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1, #F7DC6F);
    animation: rainbow-spin 3s linear infinite;
}

@keyframes rainbow-spin {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}


/* Celebration burst effect */

@keyframes celebration-burst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Floating animation for special elements */

@keyframes float-up {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-60px) rotate(360deg);
        opacity: 0;
    }
}


/* Sparkle effect */

@keyframes sparkle {
    0%,
    100% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Additional celebratory effects */

.celebration-firework {
    position: absolute;
    width: 3px;
    /* Reduced from 4px */
    height: 3px;
    /* Reduced from 4px */
    background: radial-gradient(circle, #FFD700, #FF6347);
    border-radius: 50%;
    animation: firework-explode 2s ease-out;
}

@keyframes firework-explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(8);
        /* Reduced from 10 */
        opacity: 0.8;
    }
    100% {
        transform: scale(16);
        /* Reduced from 20 */
        opacity: 0;
    }
}


/* Responsive design for iframe */

@media (max-width: 768px) {
    #as-gamified-checklist {
        max-width: 100%;
        margin: 0.5em auto;
        padding: 0.8em 0.6em;
    }
    .as-phase-header {
        padding: 0.6em 0.8em;
        font-size: 0.95em;
    }
    .as-step {
        padding: 0.6em 0.8em;
        font-size: 0.95em;
    }
    #as-progressbar-phases span {
        font-size: 0.75em;
        min-width: 50px;
    }
}


/* Ultra-compact mode for very small iframes */

@media (max-width: 480px) {
    #as-gamified-checklist {
        padding: 0.6em 0.4em;
        margin: 0.3em auto;
    }
    .as-phase-header {
        min-height: 36px;
        padding: 0.5em 0.6em;
        font-size: 0.9em;
    }
    .as-step {
        padding: 0.5em 0.6em;
        min-height: 32px;
        font-size: 0.9em;
    }
    .as-step input[type="checkbox"] {
        width: 1.2em;
        height: 1.2em;
    }
    #as-progressbar-phases span {
        font-size: 0.7em;
        min-width: 40px;
    }
}