/* Memoro Mini Trainer Styles */
.mmt-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    padding: 32px;
    max-width: 800px;
    margin: 0 auto 32px auto;
    color: #1f2937;
    position: relative;
    box-sizing: border-box;
}

.mmt-container * {
    box-sizing: border-box;
}

.mmt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.mmt-title-wrapper h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mmt-title-wrapper p {
    margin: 4px 0 0;
    font-size: 14px;
    color: #6b7280;
}

.mmt-badge {
    background: #e0f2fe;
    color: #0284c7;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* Steps */
.mmt-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
}

.mmt-steps::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.mmt-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    background: #fff;
    padding: 0 8px;
    width: 33%;
}

.mmt-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    border: 2px solid #fff;
}

.mmt-step.active .mmt-step-circle {
    background: #22c55e;
    color: #fff;
}

.mmt-step-label {
    font-size: 12px;
    color: #6b7280;
}

.mmt-step.active .mmt-step-label {
    color: #111827;
    font-weight: 500;
}

/* Main Content */
.mmt-content {
    text-align: center;
    margin-bottom: 32px;
}

.mmt-subtitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.mmt-number-display {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 24px;
    color: #111827;
}

/* Grid */
.mmt-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.mmt-card {
    width: 90px;
    height: 110px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    background: #fff;
}

.mmt-card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
}

.mmt-card.selected {
    border-color: #22c55e;
    background: #f0fdf4;
}

.mmt-card img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
}

.mmt-card span {
    font-size: 12px;
    color: #4b5563;
}

.mmt-card.selected span {
    color: #15803d;
    font-weight: 500;
}

.mmt-check-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #22c55e;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.mmt-card.selected .mmt-check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Actions */
.mmt-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.mmt-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mmt-btn-primary {
    background: #22c55e;
    color: white;
}

.mmt-btn-primary:hover {
    background: #16a34a;
}

.mmt-btn-primary:disabled {
    background: #bbf7d0;
    cursor: not-allowed;
}

.mmt-btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.mmt-btn-outline:hover {
    background: #f3f4f6;
}

/* Success Result Block */
.mmt-result-overlay {
    display: none;
}

.mmt-result-overlay.active {
    display: block;
}

.mmt-result {
    display: none;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    margin-top: 24px;
    animation: fadeInDown 0.3s ease;
}

.mmt-result.active {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mmt-result-left {
    flex: 1;
}

.mmt-result-title {
    font-size: 18px;
    font-weight: 700;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.mmt-result-sequence {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mmt-result-img {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mmt-result-img img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 4px;
}

.mmt-result-img span {
    font-size: 12px;
    color: #166534;
}

.mmt-result-plus {
    color: #16a34a;
    font-weight: bold;
}

.mmt-result-right {
    flex: 1;
    padding-left: 24px;
    border-left: 1px solid #bbf7d0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mmt-result-text {
    font-size: 14px;
    color: #166534;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Error message */
.mmt-error-msg {
    color: #ef4444;
    font-size: 14px;
    margin-top: 12px;
    display: none;
    font-weight: 500;
}

.mmt-error-msg.active {
    display: block;
    animation: shake 0.4s ease;
}

/* Intro Modal */
.mmt-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mmt-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.mmt-modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 700px;
    width: 90%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.mmt-modal-overlay.active .mmt-modal {
    transform: translateY(0);
}

.mmt-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #9ca3af;
}

.mmt-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #111827;
}

.mmt-mapping-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.mmt-mapping-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.mmt-mapping-digit {
    font-weight: 700;
    color: #374151;
    width: 20px;
    text-align: right;
    flex-shrink: 0;
}

.mmt-mapping-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.mmt-example-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 16px;
    border-radius: 8px;
}

.mmt-example-box h4 {
    margin: 0 0 8px;
    color: #166534;
    font-size: 14px;
}

.mmt-example-box p {
    margin: 0;
    color: #15803d;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

@media (max-width: 640px) {
    .mmt-container {
        padding: 16px;
        margin-bottom: 24px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-left: -16px;
        margin-right: -16px;
    }
    .mmt-header {
        margin-bottom: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .mmt-steps {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }
    .mmt-number-display {
        font-size: 48px;
        margin-bottom: 16px;
    }
    .mmt-grid {
        gap: 8px;
        margin-bottom: 20px;
    }
    .mmt-card {
        width: 75px;
        height: 95px;
    }
    .mmt-card img {
        width: 40px;
        height: 40px;
    }
    .mmt-actions {
        flex-direction: column;
        gap: 12px;
    }
    .mmt-btn {
        width: 100%;
        justify-content: center;
    }
    .mmt-result.active {
        flex-direction: column;
    }
    .mmt-result-right {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #bbf7d0;
        margin-top: 16px;
        padding-top: 16px;
    }
    .mmt-result-overlay.active {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9999;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 16px;
    }
    .mmt-result.active {
        margin: 0;
        width: 100%;
        max-width: 400px;
        box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
        max-height: 90vh;
        overflow-y: auto;
    }
}
